2025-05-05 16:17 ftp://ftp.de.debian.org/debian/pool/main/libc/libcli/libcli_1.10.7.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --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-59-generic-x86_64-with-glibc2.39 python: 3.12.3 client-version: 1.3.67 compiler: g++ (Ubuntu 14.2.0-4ubuntu2~24.04) 14.2.0 cppcheck: head 2.17.0 head-info: fcc0493 (2025-05-05 13:08:11 +0200) count: 71 71 elapsed-time: 5.0 4.9 head-timing-info: old-timing-info: head results: libcli-1.10.7/clitest.c:74:43: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable __func__ [valueFlowBailoutIncompleteVar] libcli-1.10.7/clitest.c:303:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] libcli-1.10.7/clitest.c:344:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] libcli-1.10.7/clitest.c:521:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIG_IGN [valueFlowBailoutIncompleteVar] libcli-1.10.7/clitest.c:545:5: error: Resource leak: s [resourceLeak] libcli-1.10.7/clitest.c:550:5: error: Resource leak: s [resourceLeak] libcli-1.10.7/clitest.c:94:27: warning: Either the condition '!argv[1]' is redundant or there is possible null pointer dereference: argv[1]. [nullPointerRedundantCheck] libcli-1.10.7/clitest.c:94:9: note: Assuming that condition '!argv[1]' is not redundant libcli-1.10.7/clitest.c:94:27: note: Null pointer dereference libcli-1.10.7/clitest.c:229:48: warning: Either the condition '!value' is redundant or there is possible null pointer dereference: value. [nullPointerRedundantCheck] libcli-1.10.7/clitest.c:231:9: note: Assuming that condition '!value' is not redundant libcli-1.10.7/clitest.c:229:48: note: Null pointer dereference libcli-1.10.7/clitest.c:277:48: warning: Either the condition '!word' is redundant or there is possible null pointer dereference: word. [nullPointerRedundantCheck] libcli-1.10.7/clitest.c:279:9: note: Assuming that condition '!word' is not redundant libcli-1.10.7/clitest.c:277:48: note: Null pointer dereference libcli-1.10.7/clitest.c:489:5: style: Variable 'o' is reassigned a value before the old one has been used. [redundantAssignment] libcli-1.10.7/clitest.c:487:5: note: o is assigned libcli-1.10.7/clitest.c:489:5: note: o is overwritten libcli-1.10.7/clitest.c:176:9: style: Parameter 'cli' can be declared as pointer to const. However it seems that 'pc' is a callback function, if 'cli' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libcli-1.10.7/clitest.c:505:31: note: You might need to cast the function pointer here libcli-1.10.7/clitest.c:176:9: note: Parameter 'cli' can be declared as pointer to const libcli-1.10.7/clitest.c:189:9: style: Variable 'shapeName' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/clitest.c:213:25: style: Variable 'value' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/clitest.c:238:37: style: Parameter 'cli' can be declared as pointer to const. However it seems that 'shape_validator' is a callback function, if 'cli' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libcli-1.10.7/clitest.c:449:84: note: You might need to cast the function pointer here libcli-1.10.7/clitest.c:238:37: note: Parameter 'cli' can be declared as pointer to const libcli-1.10.7/clitest.c:248:39: style: Parameter 'cli' can be declared as pointer to const [constParameterPointer] libcli-1.10.7/clitest.c:286:37: style: Parameter 'cli' can be declared as pointer to const. However it seems that 'color_validator' is a callback function, if 'cli' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libcli-1.10.7/clitest.c:430:44: note: You might need to cast the function pointer here libcli-1.10.7/clitest.c:286:37: note: Parameter 'cli' can be declared as pointer to const libcli-1.10.7/clitest.c:310:43: style: Parameter 'cli' can be declared as pointer to const [constParameterPointer] libcli-1.10.7/clitest.c:315:9: style: Variable 'color' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/clitest.c:316:9: style: Variable 'transparent' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/clitest.c:489:5: style: Variable 'o' is assigned a value that is never used. [unreadVariable] libcli-1.10.7/clitest.c:492:5: style: Variable 'c' is assigned a value that is never used. [unreadVariable] libcli-1.10.7/libcli.c:194:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] libcli-1.10.7/libcli.c:218:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] libcli-1.10.7/libcli.c:243:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] libcli-1.10.7/libcli.c:271:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] libcli-1.10.7/libcli.c:1106:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable FD_SETSIZE [valueFlowBailoutIncompleteVar] libcli-1.10.7/libcli.c:1953:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REG_NOSUB [valueFlowBailoutIncompleteVar] libcli-1.10.7/libcli.c:2995:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] libcli-1.10.7/libcli.c:3064:17: style:inconclusive: Boolean expression '!pipeline' is used in bitwise operation. Did you mean '||'? [bitwiseOnBoolean] libcli-1.10.7/libcli.c:1042:76: portability: Non reentrant function 'crypt' called. For threadsafe applications it is recommended to use the reentrant replacement function 'crypt_r'. [prohibitedcryptCalled] libcli-1.10.7/libcli.c:3064:17: style: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition] libcli-1.10.7/libcli.c:3073:11: style: Suspicious condition (assignment + comparison); Clarify expression with parentheses. [clarifyCondition] libcli-1.10.7/libcli.c:1542:20: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition] libcli-1.10.7/libcli.c:1536:30: note: outer condition: cursor==l libcli-1.10.7/libcli.c:1542:20: note: opposite inner condition: cursor!=l libcli-1.10.7/libcli.c:1109:5: error: Memory leak: cmd [memleak] libcli-1.10.7/libcli.c:3277:7: error: Memory leak: working [memleak] libcli-1.10.7/libcli.c:763:48: warning: If memory allocation fails, then there is a possible null pointer dereference: cmd [nullPointerOutOfMemory] libcli-1.10.7/libcli.c:2537:19: note: Assuming allocation function fails libcli-1.10.7/libcli.c:2537:19: note: Assignment 'cmdline=strdup(cli_command_name(cli,cli->buildmode->command))', assigned value is 0 libcli-1.10.7/libcli.c:2576:26: note: Calling function 'cli_add_history', 2nd argument 'cmdline' value is 0 libcli-1.10.7/libcli.c:754:9: note: Assuming condition is false libcli-1.10.7/libcli.c:763:48: note: Null pointer dereference libcli-1.10.7/libcli.c:2600:13: style: Variable 'cptr' is reassigned a value before the old one has been used. [redundantAssignment] libcli-1.10.7/libcli.c:2596:8: note: cptr is assigned libcli-1.10.7/libcli.c:2600:13: note: cptr is overwritten libcli-1.10.7/libcli.c:3150:15: style: Variable 'namewidth' is reassigned a value before the old one has been used. [redundantAssignment] libcli-1.10.7/libcli.c:3148:17: note: namewidth is assigned libcli-1.10.7/libcli.c:3150:15: note: namewidth is overwritten libcli-1.10.7/libcli.c:338:48: style:inconclusive: Function 'cli_set_privilege' argument 2 names different: declaration 'privilege' definition 'priv'. [funcArgNamesDifferent] libcli-1.10.7/libcli.h:209:48: note: Function 'cli_set_privilege' argument 2 names different: declaration 'privilege' definition 'priv'. libcli-1.10.7/libcli.c:338:48: note: Function 'cli_set_privilege' argument 2 names different: declaration 'privilege' definition 'priv'. libcli-1.10.7/libcli.c:2225:98: style:inconclusive: Function 'cli_register_optarg' argument 4 names different: declaration 'priviledge' definition 'privilege'. [funcArgNamesDifferent] libcli-1.10.7/libcli.h:240:98: note: Function 'cli_register_optarg' argument 4 names different: declaration 'priviledge' definition 'privilege'. libcli-1.10.7/libcli.c:2225:98: note: Function 'cli_register_optarg' argument 4 names different: declaration 'priviledge' definition 'privilege'. libcli-1.10.7/libcli.c:1176:19: style: Local variable 'n' shadows outer variable [shadowVariable] libcli-1.10.7/libcli.c:1070:7: note: Shadowed declaration libcli-1.10.7/libcli.c:1176:19: note: Shadow variable libcli-1.10.7/libcli.c:3099:24: style: Local variable 'filt' shadows outer variable [shadowVariable] libcli-1.10.7/libcli.c:3062:23: note: Shadowed declaration libcli-1.10.7/libcli.c:3099:24: note: Shadow variable libcli-1.10.7/libcli.c:228:40: style: Parameter 'cli' can be declared as pointer to const [constParameterPointer] libcli-1.10.7/libcli.c:228:65: style: Parameter 'command' can be declared as pointer to const [constParameterPointer] libcli-1.10.7/libcli.c:310:9: style: Variable 'cp' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:310:14: style: Variable 'pp' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:904:9: style: Variable 'delim_start' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:905:9: style: Variable 'delim_end' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:1053:40: style: Parameter 'cli' can be declared as pointer to const [constParameterPointer] libcli-1.10.7/libcli.c:1486:17: style: Variable 'tptr' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:1503:19: style: Variable 'wptr' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:1930:48: style: Parameter 'cli' can be declared as pointer to const. However it seems that 'cli_search_flags_validator' is a callback function, if 'cli' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libcli-1.10.7/libcli.c:686:53: note: You might need to cast the function pointer here libcli-1.10.7/libcli.c:1930:48: note: Parameter 'cli' can be declared as pointer to const libcli-1.10.7/libcli.c:1961:13: style: Variable 'p' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:2119:39: style: Parameter 'cli' can be declared as pointer to const [constParameterPointer] libcli-1.10.7/libcli.c:2171:56: style: Parameter 'name' can be declared as pointer to const [constParameterPointer] libcli-1.10.7/libcli.c:2171:68: style: Parameter 'find_after' can be declared as pointer to const [constParameterPointer] libcli-1.10.7/libcli.c:2190:9: style: Variable 'cp' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:2190:14: style: Variable 'pp' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:2354:73: style: Parameter 'find_after' can be declared as pointer to const [constParameterPointer] libcli-1.10.7/libcli.c:2382:90: style: Parameter 'mode_text' can be declared as pointer to const [constParameterPointer] libcli-1.10.7/libcli.c:2385:22: style: Variable 'o' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:3126:35: style: Parameter 'nameptr' can be declared as pointer to const [constParameterPointer] libcli-1.10.7/libcli.c:3131:9: style: Variable 'crlf' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:3186:9: style: Variable 'delim_start' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:3187:9: style: Variable 'delim_end' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:3249:11: style: Variable 'nameptr' can be declared as pointer to const [constVariablePointer] libcli-1.10.7/libcli.c:124:15: style: struct member 'cli_filter_cmds::cmd' is never used. [unusedStructMember] libcli-1.10.7/libcli.c:125:15: style: struct member 'cli_filter_cmds::help' is never used. [unusedStructMember] libcli-1.10.7/libcli.c:190:20: style: Variable 'thisTime' is assigned a value that is never used. [unreadVariable] libcli-1.10.7/libcli.c:1070:71: style: Variable 'cursor' is assigned a value that is never used. [unreadVariable] libcli-1.10.7/libcli.c:3176:15: style: Variable 'namewidth' is assigned a value that is never used. [unreadVariable] diff: DONE