Skip to content

Commit

Permalink
do not deref a NULL camera_time (Coverity)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmeissner committed Sep 3, 2013
1 parent a3fd0a9 commit 3509619
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions camlibs/canon/canon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2650,11 +2650,11 @@ canon_int_get_time (Camera *camera, time_t *camera_time, GPContext *context)
return GP_ERROR_CORRUPTED_DATA;
}

if (camera_time != NULL)
if (camera_time != NULL) {
*camera_time = (time_t) le32atoh (msg + 4);

/* XXX should strip \n at the end of asctime() return data */
GP_DEBUG ("Camera time: %s", asctime (gmtime (camera_time)));
/* XXX should strip \n at the end of asctime() return data */
GP_DEBUG ("Camera time: %s", asctime (gmtime (camera_time)));
}

return GP_OK;
}
Expand Down

0 comments on commit 3509619

Please sign in to comment.