Closed Vidrep closed 5 years ago
The code uses char indexes to use the data arrays, so this isn't a problem per se. It could be more readable by using uint32 pointers.
There were 13 errors detected in total, but I only did a copy/paste of 2. Can I zip up the html report and send it to you? It may be worth a look.
You can attach to this ticket.
Here it is: scan-build-2018-10-08-100614-3418-1.zip
Korli, I have also attached similar reports for FtpPositive, and BePDF, if you don't mind having a look. Thanks!
Here is the summary of the above report. Clang Static Analyzer found 18 potential bugs. BugReport.pdf
File: ptp.c Warning: line 2012, column 10 Result of 'calloc' is converted to a pointer of type 'unsigned char', which is incompatible with sizeof operand type; 'uint32_t'data = calloc(sizeof(uint32_t),3);
File: ./ptp-pack.c Warning: line 252, column 10 Result of 'malloc' is converted to a pointer of type 'unsigned char', which is incompatible with sizeof operand type 'uint32_t' : data = malloc ((arraylen+1)sizeof(uint32_t));