Check parameter and return error 01/199601/1
authorpr.jung <pr.jung@samsung.com>
Wed, 13 Feb 2019 07:29:48 +0000 (16:29 +0900)
committerpr.jung <pr.jung@samsung.com>
Wed, 13 Feb 2019 07:29:48 +0000 (16:29 +0900)
Change-Id: Id539067762144bfdbf34b1b419d2126f5f8ac76e
Signed-off-by: pr.jung <pr.jung@samsung.com>
include/storage-internal.h
src/storage-inhouse.c

index 609ebf5..a7ac3f8 100644 (file)
@@ -155,6 +155,7 @@ typedef enum {
  *         otherwise a negative error value
  *
  * @retval #STORAGE_ERROR_NONE               Successful
+ * @retval #STORAGE_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval #STORAGE_ERROR_OPERATION_FAILED   Operation failed
  * @retval #STORAGE_ERROR_OUT_OF_MEMORY      Out of memory
  */
index 946b4d8..5a9ca1f 100755 (executable)
@@ -429,6 +429,9 @@ API int storage_is_mounted_opt_usr(storage_part_mount_e *mounted)
        int ret;
        bool found = false;
 
+       if (!mounted)
+               return STORAGE_ERROR_INVALID_PARAMETER;
+
        ret = blkid_get_cache(&cache, NULL);
        if (ret < 0) {
                _E("Failed to get cache"); //LCOV_EXCL_LINE