HaikuArchives / PhotoGrabber

PhotoGrabber is an application that downloads/deletes pictures from USB digital cameras
2 stars 10 forks source link

Fixes bugs reported by Clang Static Analyzer. #22

Closed claire50 closed 5 years ago

claire50 commented 5 years ago

Fixes #20.

owenca commented 5 years ago

https://github.com/HaikuArchives/PhotoGrabber/blob/f900c57b9b31b769514421b3b6cfdc0b77cdbb8a/plugins/ptp/libptp/ptp.c#L2014-L2015 Although this is a false positive, we can improve the code here and at the same time silence Clang Static Analyzer:

size = sizeof(uint32_t) * 3;
data = calloc(size, 1);
owenca commented 5 years ago

^I was talking about usb.c line 133.