Fix Svace issue and warning issue 94/102494/1
authorJihoon Jung <jh8801.jung@samsung.com>
Tue, 6 Dec 2016 04:14:15 +0000 (13:14 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Tue, 6 Dec 2016 04:14:59 +0000 (13:14 +0900)
- Svace ID : 79264, 151370

Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: Icbc92de21d7187ece2667d80c7e21c2ba2712016

src/libmtp.c
src/playlist-spl.c
src/ptp-pack.c

index cf34a72..171f66c 100755 (executable)
@@ -9084,12 +9084,6 @@ int LIBMTP_GetPartialObject(LIBMTP_mtpdevice_t *device, uint32_t const id,
     return -2;
   }
 
-  if (offset >> 32 != 0) {
-    add_error_to_errorstack(device, LIBMTP_ERROR_GENERAL,
-      "LIBMTP_GetPartialObject: PTP_OC_GetPartialObject only supports 32bit offsets");
-    return -3;
-  }
-
   ret = ptp_getpartialobject(params, id, offset, maxbytes, data, size);
   if (ret == PTP_RC_OK)
       return 0;
index 5a6a3b0..de471a8 100755 (executable)
@@ -432,7 +432,7 @@ static text_t* read_into_spl_text_t(LIBMTP_mtpdevice_t *device, const int fd)
 
   // set the next pointer at the end
   // if there is any list
-  if(head != NULL)
+  if(head != NULL && tail != NULL)
     tail->next = NULL;
 
   // return the head of the list (NULL if no list)
index 71c82d6..3d410a1 100755 (executable)
@@ -2019,7 +2019,7 @@ ptp_unpack_CANON_changes (PTPParams *params, unsigned char* data, int datasize,
                        if (mask & CANON_EOS_OLC_BUTTON) {
                                ce[i].type = PTP_CANON_EOS_CHANGES_TYPE_UNKNOWN;
                                ce[i].u.info = malloc(strlen("Button 1234567"));
-                               sprintf(ce[i].u.info, "Button %d",  dtoh16a(curdata+curoff));
+                               snprintf(ce[i].u.info, strlen("Button 1234567"), "Button %d",  dtoh16a(curdata+curoff));
                                i++;
                                curoff += 2;
                        }