2025-01-27 02:57 ftp://ftp.de.debian.org/debian/pool/main/b/bti/bti_034.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --library=libcurl --library=pcre --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 -j1 platform: Linux-6.8.0-51-generic-x86_64-with-glibc2.39 python: 3.12.3 client-version: 1.3.65 compiler: g++ (Ubuntu 14.2.0-4ubuntu2~24.04) 14.2.0 cppcheck: head 2.16.0 head-info: 0eb54ba (2025-01-25 21:24:33 +0100) count: 55 7 elapsed-time: 0.8 0.1 head-timing-info: old-timing-info: head results: bti-034/bti.c:56:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] bti-034/bti.c:98:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] bti-034/bti.c:110:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] bti-034/bti.c:164:4: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] bti-034/bti.c:295:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] bti-034/bti.c:378:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XML_ELEMENT_NODE [valueFlowBailoutIncompleteVar] bti-034/bti.c:428:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] bti-034/bti.c:527:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable json_type_array [valueFlowBailoutIncompleteVar] bti-034/bti.c:562:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable json_type_string [valueFlowBailoutIncompleteVar] bti-034/bti.c:610:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] bti-034/bti.c:664:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] bti-034/bti.c:690:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] bti-034/bti.c:723:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EINVAL [valueFlowBailoutIncompleteVar] bti-034/bti.c:749:32: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable oauth_cmpstringp [valueFlowBailoutIncompleteVar] bti-034/bti.c:793:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EINVAL [valueFlowBailoutIncompleteVar] bti-034/bti.c:883:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EINVAL [valueFlowBailoutIncompleteVar] bti-034/bti.c:1231:26: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdin [valueFlowBailoutIncompleteVar] bti-034/bti.c:1250:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable ECHO [valueFlowBailoutIncompleteVar] bti-034/bti.c:1297:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] bti-034/bti.c:1468:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] bti-034/bti.c:1575:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] bti-034/bti.c:1167:13: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] bti-034/bti.c:1297:3: warning: %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] bti-034/bti.c:1310:4: warning: %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] bti-034/bti.c:1468:2: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] bti-034/bti.c:1486:3: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] bti-034/bti.c:1489:3: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] bti-034/bti.c:1530:2: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] bti-034/bti.c:1318:5: error: Common realloc mistake: 'ranges' nulled but not freed upon failure [memleakOnRealloc] bti-034/bti.c:1420:22: warning: If memory allocation fails, then there is a possible null pointer dereference: big [nullPointerOutOfMemory] bti-034/bti.c:1482:22: note: Assuming allocation function fails bti-034/bti.c:1482:22: note: Assignment 'url=strndup(text+url_start,long_url_len)', assigned value is 0 bti-034/bti.c:1487:37: note: Calling function 'shrink_one_url', 2nd argument 'url' value is 0 bti-034/bti.c:1420:22: note: Null pointer dereference bti-034/bti.c:1384:6: style: Variable 'rc' is reassigned a value before the old one has been used. [redundantAssignment] bti-034/bti.c:1382:6: note: rc is assigned bti-034/bti.c:1384:6: note: rc is overwritten bti-034/bti.c:1386:6: style: Variable 'rc' is reassigned a value before the old one has been used. [redundantAssignment] bti-034/bti.c:1384:6: note: rc is assigned bti-034/bti.c:1386:6: note: rc is overwritten bti-034/bti.c:85:30: style: Parameter 's' can be declared as pointer to const [constParameterPointer] bti-034/bti.c:307:8: style: Variable 'home' can be declared as pointer to const [constVariablePointer] bti-034/bti.c:357:45: style: Parameter 'session' can be declared as pointer to const [constParameterPointer] bti-034/bti.c:357:63: style: Parameter 'user' can be declared as pointer to const [constParameterPointer] bti-034/bti.c:358:17: style: Parameter 'id' can be declared as pointer to const [constParameterPointer] bti-034/bti.c:358:30: style: Parameter 'created' can be declared as pointer to const [constParameterPointer] bti-034/bti.c:358:48: style: Parameter 'text' can be declared as pointer to const [constParameterPointer] bti-034/bti.c:715:35: style: Parameter 'buffer' can be declared as pointer to const. However it seems that 'curl_callback' is a callback function, if 'buffer' is declared with const you might also need to cast function pointer(s). [constParameterCallback] bti-034/bti.c:992:49: note: You might need to cast the function pointer here bti-034/bti.c:715:35: note: Parameter 'buffer' can be declared as pointer to const bti-034/bti.c:788:8: style: Variable 'verifier' can be declared as pointer to const [constVariablePointer] bti-034/bti.c:879:8: style: Variable 'escaped_tweet' can be declared as pointer to const [constVariablePointer] bti-034/bti.c:1158:41: style: Parameter 'session' can be declared as pointer to const [constParameterPointer] bti-034/bti.c:1241:56: style: Parameter 'host' can be declared as pointer to const [constParameterPointer] bti-034/bti.c:1408:36: style: Parameter 'rwepipe' can be declared as pointer to const [constParameterPointer] bti-034/bti.c:1534:26: style: Parameter 'argv' can be declared as const array [constParameter] bti-034/bti.c:1567:8: style: Variable 'http_proxy' can be declared as pointer to const [constVariablePointer] bti-034/bti.c:1386:6: style: Variable 'rc' is assigned a value that is never used. [unreadVariable] bti-034/config.c:143:47: style: Parameter 'value' can be declared as pointer to const [constParameterPointer] bti-034/config.c:157:43: style: Parameter 'value' can be declared as pointer to const [constParameterPointer] bti-034/config.c:220:57: style: Parameter 'value' can be declared as pointer to const [constParameterPointer] bti-034/config.c:234:59: style: Parameter 'value' can be declared as pointer to const [constParameterPointer] bti-034/config.c:290:57: style: Parameter 'key' can be declared as pointer to const [constParameterPointer] bti-034/config.c:131:7: style: Variable 'temp' is assigned a value that is never used. [unreadVariable] bti-034/bti.c:1420:22: error: Null pointer dereference: big [ctunullpointer] bti-034/bti.c:1482:22: note: Assuming allocation function fails bti-034/bti.c:1482:22: note: Assignment 'url=strndup(text+url_start,long_url_len)', assigned value is 0 bti-034/bti.c:1487:23: note: Calling function shrink_one_url, 2nd argument is null bti-034/bti.c:1420:22: note: Dereferencing argument big that is null diff: head bti-034/bti.c:110:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] head bti-034/bti.c:1158:41: style: Parameter 'session' can be declared as pointer to const [constParameterPointer] head bti-034/bti.c:1167:13: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] head bti-034/bti.c:1231:26: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdin [valueFlowBailoutIncompleteVar] head bti-034/bti.c:1241:56: style: Parameter 'host' can be declared as pointer to const [constParameterPointer] head bti-034/bti.c:1250:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable ECHO [valueFlowBailoutIncompleteVar] head bti-034/bti.c:1297:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] head bti-034/bti.c:1297:3: warning: %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] head bti-034/bti.c:1310:4: warning: %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] head bti-034/bti.c:1318:5: error: Common realloc mistake: 'ranges' nulled but not freed upon failure [memleakOnRealloc] head bti-034/bti.c:1384:6: style: Variable 'rc' is reassigned a value before the old one has been used. [redundantAssignment] bti-034/bti.c:1382:6: note: rc is assigned bti-034/bti.c:1384:6: note: rc is overwritten head bti-034/bti.c:1386:6: style: Variable 'rc' is assigned a value that is never used. [unreadVariable] head bti-034/bti.c:1386:6: style: Variable 'rc' is reassigned a value before the old one has been used. [redundantAssignment] bti-034/bti.c:1384:6: note: rc is assigned bti-034/bti.c:1386:6: note: rc is overwritten head bti-034/bti.c:1408:36: style: Parameter 'rwepipe' can be declared as pointer to const [constParameterPointer] head bti-034/bti.c:1420:22: error: Null pointer dereference: big [ctunullpointer] bti-034/bti.c:1482:22: note: Assuming allocation function fails bti-034/bti.c:1482:22: note: Assignment 'url=strndup(text+url_start,long_url_len)', assigned value is 0 bti-034/bti.c:1487:23: note: Calling function shrink_one_url, 2nd argument is null bti-034/bti.c:1420:22: note: Dereferencing argument big that is null head bti-034/bti.c:1420:22: warning: If memory allocation fails, then there is a possible null pointer dereference: big [nullPointerOutOfMemory] bti-034/bti.c:1482:22: note: Assuming allocation function fails bti-034/bti.c:1482:22: note: Assignment 'url=strndup(text+url_start,long_url_len)', assigned value is 0 bti-034/bti.c:1487:37: note: Calling function 'shrink_one_url', 2nd argument 'url' value is 0 bti-034/bti.c:1420:22: note: Null pointer dereference head bti-034/bti.c:1468:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] head bti-034/bti.c:1468:2: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] head bti-034/bti.c:1486:3: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] head bti-034/bti.c:1489:3: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] head bti-034/bti.c:1530:2: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] head bti-034/bti.c:1534:26: style: Parameter 'argv' can be declared as const array [constParameter] head bti-034/bti.c:1567:8: style: Variable 'http_proxy' can be declared as pointer to const [constVariablePointer] head bti-034/bti.c:1575:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] head bti-034/bti.c:164:4: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] head bti-034/bti.c:295:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] head bti-034/bti.c:307:8: style: Variable 'home' can be declared as pointer to const [constVariablePointer] head bti-034/bti.c:357:45: style: Parameter 'session' can be declared as pointer to const [constParameterPointer] head bti-034/bti.c:357:63: style: Parameter 'user' can be declared as pointer to const [constParameterPointer] head bti-034/bti.c:358:17: style: Parameter 'id' can be declared as pointer to const [constParameterPointer] head bti-034/bti.c:358:30: style: Parameter 'created' can be declared as pointer to const [constParameterPointer] head bti-034/bti.c:358:48: style: Parameter 'text' can be declared as pointer to const [constParameterPointer] head bti-034/bti.c:378:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XML_ELEMENT_NODE [valueFlowBailoutIncompleteVar] head bti-034/bti.c:428:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] head bti-034/bti.c:527:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable json_type_array [valueFlowBailoutIncompleteVar] head bti-034/bti.c:562:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable json_type_string [valueFlowBailoutIncompleteVar] head bti-034/bti.c:56:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] head bti-034/bti.c:610:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] 2.16.0 bti-034/bti.c:615:2: error: syntax error [syntaxError] head bti-034/bti.c:664:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] head bti-034/bti.c:690:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] head bti-034/bti.c:715:35: style: Parameter 'buffer' can be declared as pointer to const. However it seems that 'curl_callback' is a callback function, if 'buffer' is declared with const you might also need to cast function pointer(s). [constParameterCallback] bti-034/bti.c:992:49: note: You might need to cast the function pointer here bti-034/bti.c:715:35: note: Parameter 'buffer' can be declared as pointer to const head bti-034/bti.c:723:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EINVAL [valueFlowBailoutIncompleteVar] head bti-034/bti.c:749:32: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable oauth_cmpstringp [valueFlowBailoutIncompleteVar] head bti-034/bti.c:788:8: style: Variable 'verifier' can be declared as pointer to const [constVariablePointer] head bti-034/bti.c:793:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EINVAL [valueFlowBailoutIncompleteVar] head bti-034/bti.c:85:30: style: Parameter 's' can be declared as pointer to const [constParameterPointer] head bti-034/bti.c:879:8: style: Variable 'escaped_tweet' can be declared as pointer to const [constVariablePointer] head bti-034/bti.c:883:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EINVAL [valueFlowBailoutIncompleteVar] head bti-034/bti.c:98:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] DONE