summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Jung <jh8801.jung@samsung.com>2016-12-06 20:47:17 +0900
committerJihoon Jung <jh8801.jung@samsung.com>2016-12-07 13:35:32 +0900
commitd7de12fef6461073e652458ada9799200b9d18ff (patch)
tree97da2f5f82c0b4203bf33f80885688bbff666944
parent5ce928b92759c93bf0edbb10e3f6040a1f26259b (diff)
downloadlibmtp-d7de12fef6461073e652458ada9799200b9d18ff.tar.gz
libmtp-d7de12fef6461073e652458ada9799200b9d18ff.tar.bz2
libmtp-d7de12fef6461073e652458ada9799200b9d18ff.zip
Fix Svace issue : 159149, 159150
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com> Change-Id: Iac53e6138c0490a0bdf096dcb223a2cf6e930ea6
-rwxr-xr-xsrc/libmtp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libmtp.c b/src/libmtp.c
index 171f66c..a10a07f 100755
--- a/src/libmtp.c
+++ b/src/libmtp.c
@@ -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);