Skip to content

Commit

Permalink
fixed 2 buffer overrreads (Coverity)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmeissner committed Sep 1, 2013
1 parent a477efb commit aab436b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions camlibs/ptp2/olympus-wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ ums_wrap_getresp (PTPParams* params, PTPContainer* resp)

GP_DEBUG("send_scsi_cmd ret %d", ret);

memcpy (&usbresp, buf, sizeof(usbresp));
memcpy (&usbresp, buf, sizeof(buf));
resp->Code = dtoh16(usbresp.code);
resp->Nparam = (dtoh32(usbresp.length)-PTP_USB_BULK_REQ_LEN)/sizeof(uint32_t);
resp->Param1 = dtoh32(usbresp.payload.params.param1);
Expand Down Expand Up @@ -359,7 +359,7 @@ ums_wrap_getdata (PTPParams* params, PTPContainer* ptp, PTPDataHandler *putter)

GP_DEBUG("send_scsi_cmd ret %d", ret);

memcpy (&usbresp, buf, sizeof(usbresp));
memcpy (&usbresp, buf, sizeof(buf));
if ((dtoh16(usbresp.code) != ptp->Code) && (dtoh16(usbresp.code) != PTP_RC_OK)) {
GP_DEBUG( "ums_wrap_getdata *** PTP code %04x during PTP data in size read", dtoh16(usbresp.code));
/* break; */
Expand Down

0 comments on commit aab436b

Please sign in to comment.