xiaoyin0208 / lz4

Automatically exported from code.google.com/p/lz4
0 stars 0 forks source link

Various issues #75

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
bench.c:
* Before line 308, there should be a `free(chunkP);`.

fullbench.c:
* Before line 329, there should be a `free(chunkP);`.

lz4c.c:
* On lines 410 and 549, a less-than-zero check is done on an unsigned integer.
* The `if (errorcode)` checks on lines 374 and 519 are unnecessary because 
get_fileHandle() always returns 0.

Original issue reported on code.google.com by msc...@gmail.com on 24 Jul 2013 at 9:36

GoogleCodeExporter commented 8 years ago
Hi Brian

Thanks, quite a thorough investigation :)
It happens that some of these corrections were already completed into latest 
rc, but you nonetheless managed to find more of them.

Yes, this will be corrected.

Original comment by yann.col...@gmail.com on 25 Jul 2013 at 11:41

GoogleCodeExporter commented 8 years ago

Original comment by yann.col...@gmail.com on 25 Jul 2013 at 11:41

GoogleCodeExporter commented 8 years ago
You'll find in attached file a proposed rc,
which should correct all the points mentioned in this issue.

Rgds

Original comment by yann.col...@gmail.com on 25 Jul 2013 at 11:45

Attachments:

GoogleCodeExporter commented 8 years ago
FWIW cppcheck[1] is the one that found these issues :-)

With the lz4rc.zip provided, the following issues (still) exist:

bench.c:
* Before line 347, there should be a `free(chunkP);`.

fullbench.c:
* Before line 368, there should be a `free(chunkP);`.

lz4c:
* Before line 642, there should be a `free(headerBuffer);`.
* On line 365, a less-than-zero check is done on an unsigned integer.
* The `if (errorcode)` checks on line 340 is unnecessary because 
get_fileHandle() always returns 0.

[1] http://cppcheck.sourceforge.net/

Original comment by msc...@gmail.com on 25 Jul 2013 at 12:54

GoogleCodeExporter commented 8 years ago
Nice tip, I should look more into this tool :)

Original comment by yann.col...@gmail.com on 25 Jul 2013 at 1:22

GoogleCodeExporter commented 8 years ago
The following rc seems to successfully pass cppCheck
(excluding style-related warnings)

Original comment by yann.col...@gmail.com on 25 Jul 2013 at 3:15

Attachments:

GoogleCodeExporter commented 8 years ago
Yep, that one looks good now :-)

Original comment by msc...@gmail.com on 25 Jul 2013 at 5:39

GoogleCodeExporter commented 8 years ago
Integrated into r99

Original comment by yann.col...@gmail.com on 27 Jul 2013 at 11:29