2025-05-04 21:59 ftp://ftp.de.debian.org/debian/pool/main/g/gztool/gztool_1.8.0.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --library=zlib --inconclusive --enable=style,information --inline-suppr --template=daca2 --disable=missingInclude --suppress=unmatchedSuppression --check-library --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning --suppress=normalCheckLevelConditionExpressions -D__GNUC__ --platform=unix64 -j3 platform: Linux-6.8.0-1022-oracle-aarch64-with-glibc2.39 python: 3.12.3 client-version: 1.3.67 compiler: g++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 cppcheck: head 2.17.0 head-info: 88ef81e (2025-05-02 08:42:38 +0200) count: 47 47 elapsed-time: 2.9 2.9 head-timing-info: old-timing-info: head results: gztool-1.8.0/gztool.c:277:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gztool-1.8.0/gztool.c:2065:22: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] gztool-1.8.0/gztool.c:3475:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdin [valueFlowBailoutIncompleteVar] gztool-1.8.0/gztool.c:3881:22: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] gztool-1.8.0/gztool.c:4270:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdin [valueFlowBailoutIncompleteVar] gztool-1.8.0/gztool.c:4565:22: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] gztool-1.8.0/gztool.c:4931:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gztool-1.8.0/gztool.c:4947:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] gztool-1.8.0/gztool.c:5108:32: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable optarg [valueFlowBailoutIncompleteVar] gztool-1.8.0/gztool.c:1513:44: error: Array 'buffer[16387]' accessed at index -1, which is out of bounds. [negativeIndex] gztool-1.8.0/gztool.c:1500:47: note: Assignment 'buffer_position=0', assigned value is 0 gztool-1.8.0/gztool.c:1531:41: note: buffer_position is decremented', new value is -1 gztool-1.8.0/gztool.c:1513:44: note: Negative array index gztool-1.8.0/gztool.c:324:12: style: Return value '!(*((char*)(&one)))' is always false [knownConditionTrueFalse] gztool-1.8.0/gztool.c:323:15: note: Assignment 'one=1', assigned value is 1 gztool-1.8.0/gztool.c:324:12: note: Return value '!(*((char*)(&one)))' is always false gztool-1.8.0/gztool.c:361:25: style: Condition 'endiannes_is_big()' is always false [knownConditionTrueFalse] gztool-1.8.0/gztool.c:323:15: note: Assignment 'one=1', assigned value is 1 gztool-1.8.0/gztool.c:361:25: note: Calling function 'endiannes_is_big' returns 0 gztool-1.8.0/gztool.c:361:25: note: Condition 'endiannes_is_big()' is always false gztool-1.8.0/gztool.c:397:25: style: Condition 'endiannes_is_big()' is always false [knownConditionTrueFalse] gztool-1.8.0/gztool.c:323:15: note: Assignment 'one=1', assigned value is 1 gztool-1.8.0/gztool.c:397:25: note: Calling function 'endiannes_is_big' returns 0 gztool-1.8.0/gztool.c:397:25: note: Condition 'endiannes_is_big()' is always false gztool-1.8.0/gztool.c:2138:17: style: Condition '++actual_index_point' is always true [knownConditionTrueFalse] gztool-1.8.0/gztool.c:2158:17: style: Condition '++actual_index_point' is always true [knownConditionTrueFalse] gztool-1.8.0/gztool.c:4776:21: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] gztool-1.8.0/gztool.c:4776:21: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] gztool-1.8.0/gztool.c:4805:25: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] gztool-1.8.0/gztool.c:3854:13: error: Memory leak: input [memleak] gztool-1.8.0/gztool.c:3854:13: error: Memory leak: output [memleak] gztool-1.8.0/gztool.c:4569:13: error: Memory leak: gzip_filename [memleak] gztool-1.8.0/gztool.c:483:27: error: Common realloc mistake: 'out_complete' nulled but not freed upon failure [memleakOnRealloc] gztool-1.8.0/gztool.c:582:27: error: Common realloc mistake: 'out_complete' nulled but not freed upon failure [memleakOnRealloc] gztool-1.8.0/gztool.c:415:21: warning: If memory allocation fails, then there is a possible null pointer dereference: endian_ptr [nullPointerOutOfMemory] gztool-1.8.0/gztool.c:395:24: note: Assuming allocation function fails gztool-1.8.0/gztool.c:395:24: note: Assignment 'endian_ptr=malloc(size)', assigned value is 0 gztool-1.8.0/gztool.c:415:21: note: Null pointer dereference gztool-1.8.0/gztool.c:3625:31: warning: If memory allocation fails, then there is a possible null pointer dereference: in [nullPointerOutOfMemory] gztool-1.8.0/gztool.c:3620:16: note: Assuming allocation function fails gztool-1.8.0/gztool.c:3620:16: note: Assignment 'in=malloc(16384)', assigned value is 0 gztool-1.8.0/gztool.c:3625:31: note: Null pointer dereference gztool-1.8.0/gztool.c:3709:31: warning: If memory allocation fails, then there is a possible null pointer dereference: in [nullPointerOutOfMemory] gztool-1.8.0/gztool.c:3704:16: note: Assuming allocation function fails gztool-1.8.0/gztool.c:3704:16: note: Assignment 'in=malloc(16384)', assigned value is 0 gztool-1.8.0/gztool.c:3709:31: note: Null pointer dereference gztool-1.8.0/gztool.c:4284:26: warning:inconclusive: If memory allocation fails, then there is a possible null pointer dereference: out_filename [nullPointerOutOfMemory] gztool-1.8.0/gztool.c:4281:34: note: Assuming allocation function fails gztool-1.8.0/gztool.c:4281:34: note: Assignment 'out_filename=malloc(strlen(file_name)+3+1)', assigned value is 0 gztool-1.8.0/gztool.c:4284:26: note: Null pointer dereference gztool-1.8.0/gztool.c:4382:28: warning: Either the condition 'NULL==index' is redundant or there is possible null pointer dereference: index. [nullPointerRedundantCheck] gztool-1.8.0/gztool.c:4348:23: note: Assuming that condition 'NULL==index' is not redundant gztool-1.8.0/gztool.c:4382:28: note: Null pointer dereference gztool-1.8.0/gztool.c:4421:17: warning:inconclusive: If memory allocation fails, then there is a possible null pointer dereference: output_filename [nullPointerOutOfMemory] gztool-1.8.0/gztool.c:4419:47: note: Assuming allocation function fails gztool-1.8.0/gztool.c:4419:47: note: Assignment 'output_filename=malloc(strlen(file_name)+1)', assigned value is 0 gztool-1.8.0/gztool.c:4421:17: note: Null pointer dereference gztool-1.8.0/gztool.c:4424:30: warning:inconclusive: If memory allocation fails, then there is a possible null pointer dereference: output_filename [nullPointerOutOfMemory] gztool-1.8.0/gztool.c:4419:47: note: Assuming allocation function fails gztool-1.8.0/gztool.c:4419:47: note: Assignment 'output_filename=malloc(strlen(file_name)+1)', assigned value is 0 gztool-1.8.0/gztool.c:4424:30: note: Null pointer dereference gztool-1.8.0/gztool.c:4870:12: warning: If memory allocation fails, then there is a possible null pointer dereference: input [nullPointerOutOfMemory] gztool-1.8.0/gztool.c:4869:19: note: Assuming allocation function fails gztool-1.8.0/gztool.c:4869:19: note: Assignment 'input=malloc(strlen(original_input)+1)', assigned value is 0 gztool-1.8.0/gztool.c:4870:12: note: Null pointer dereference gztool-1.8.0/gztool.c:4872:17: warning: If memory allocation fails, then there is a possible null pointer dereference: input [nullPointerOutOfMemory] gztool-1.8.0/gztool.c:4869:19: note: Assuming allocation function fails gztool-1.8.0/gztool.c:4869:19: note: Assignment 'input=malloc(strlen(original_input)+1)', assigned value is 0 gztool-1.8.0/gztool.c:4872:17: note: Null pointer dereference gztool-1.8.0/gztool.c:4915:32: warning: Either the condition 'NULL!=input' is redundant or there is possible null pointer dereference: input. [nullPointerRedundantCheck] gztool-1.8.0/gztool.c:4917:15: note: Assuming that condition 'NULL!=input' is not redundant gztool-1.8.0/gztool.c:4915:32: note: Null pointer dereference gztool-1.8.0/gztool.c:2991:35: style: Checking if unsigned expression 'offset_in' is less than zero. [unsignedLessThanZero] gztool-1.8.0/gztool.c:5428:30: style: Checking if unsigned expression 'span_between_points' is less than zero. [unsignedLessThanZero] gztool-1.8.0/gztool.c:1539:42: style: Local variable 'strm' shadows outer variable [shadowVariable] gztool-1.8.0/gztool.c:1056:21: note: Shadowed declaration gztool-1.8.0/gztool.c:1539:42: note: Shadow variable gztool-1.8.0/gztool.c:1541:47: style: Local variable 'buffer' shadows outer variable [shadowVariable] gztool-1.8.0/gztool.c:1464:35: note: Shadowed declaration gztool-1.8.0/gztool.c:1541:47: note: Shadow variable gztool-1.8.0/gztool.c:1542:47: style: Local variable 'window' shadows outer variable [shadowVariable] gztool-1.8.0/gztool.c:1078:26: note: Shadowed declaration gztool-1.8.0/gztool.c:1542:47: note: Shadow variable gztool-1.8.0/gztool.c:2229:19: style: Local variable 'index_file' shadows outer variable [shadowVariable] gztool-1.8.0/gztool.c:1994:11: note: Shadowed declaration gztool-1.8.0/gztool.c:2229:19: note: Shadow variable gztool-1.8.0/gztool.c:2628:36: style: Local variable 'ret' shadows outer variable [shadowVariable] gztool-1.8.0/gztool.c:1967:28: note: Shadowed declaration gztool-1.8.0/gztool.c:2628:36: note: Shadow variable gztool-1.8.0/gztool.c:297:11: style: Variable 'SI_UNITS' can be declared as const array [constVariable] gztool-1.8.0/gztool.c:299:11: style: Variable 'SI_BINARY_UNITS' can be declared as const array [constVariable] gztool-1.8.0/gztool.c:441:52: style: Parameter 'source' can be declared as pointer to const [constParameterPointer] gztool-1.8.0/gztool.c:528:54: style: Parameter 'source' can be declared as pointer to const [constParameterPointer] gztool-1.8.0/gztool.c:4541:52: style: Parameter 'input_gzip_filename' can be declared as pointer to const [constParameterPointer] gztool-1.8.0/gztool.c:4861:11: style: Variable 'PowerSuffixes' can be declared as pointer to const [constVariablePointer] gztool-1.8.0/gztool.c:4860:16: style: Variable 'i' is assigned a value that is never used. [unreadVariable] diff: DONE