Fix Svace issue : 159149, 159150 10/103010/1
authorJihoon Jung <jh8801.jung@samsung.com>
Tue, 6 Dec 2016 11:47:17 +0000 (20:47 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Wed, 7 Dec 2016 04:35:32 +0000 (13:35 +0900)
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: Iac53e6138c0490a0bdf096dcb223a2cf6e930ea6

src/libmtp.c

index 171f66c..a10a07f 100755 (executable)
@@ -6283,6 +6283,11 @@ static int send_file_object_info(LIBMTP_mtpdevice_t *device, LIBMTP_file_t *file
     }
     free(properties);
 
+    if (nrofprops == 0 || props == NULL) {
+        LIBMTP_INFO("prop list doesn't exist");
+        return -1;
+    }
+
     ret = ptp_mtp_sendobjectproplist(params, &store, &localph, &filedata->item_id,
                                     of, filedata->filesize, props, nrofprops);
 
@@ -7776,6 +7781,11 @@ static int create_new_abstract_list(LIBMTP_mtpdevice_t *device,
     }
     free(properties);
 
+    if (nrofprops == 0 || props == NULL) {
+        LIBMTP_INFO("prop list doesn't exist");
+        return -1;
+    }
+
     ret = ptp_mtp_sendobjectproplist(params, &store, &localph, newid,
                                     objectformat, 0, props, nrofprops);