2026-05-05 02:43 ftp://ftp.de.debian.org/debian/pool/main/s/sockstat/sockstat_0.4.2.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --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-111-generic-x86_64-with-glibc2.39 python: 3.12.3 client-version: 1.3.70 compiler: g++ (Ubuntu 14.2.0-4ubuntu2~24.04.1) 14.2.0 cppcheck: head 2.20.0 head-info: 519958a (2026-05-04 15:03:10 +0200) count: 53 53 elapsed-time: 1.4 0.8 head-timing-info: old-timing-info: head results: sockstat/sockstat.c:148:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] sockstat/sockstat.c:266:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable AF_INET6 [valueFlowBailoutIncompleteVar] sockstat/sockstat.c:273:26: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable INADDR_ANY [valueFlowBailoutIncompleteVar] sockstat/sockstat.c:399:32: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable s6_addr [valueFlowBailoutIncompleteVar] sockstat/sockstat.c:516:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] sockstat/sockstat.c:529:59: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EOF [valueFlowBailoutIncompleteVar] sockstat/sockstat.c:569:8: warning:inconclusive: The buffer 'o_pname' may not be null-terminated after the call to strncpy(). [terminateStrncpy] sockstat/sockstat.c:336:8: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] sockstat/sockstat.c:557:17: portability: Non reentrant function 'getgrnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getgrnam_r'. [prohibitedgetgrnamCalled] sockstat/sockstat.c:576:17: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] sockstat/sockstat.c:730:12: portability: Non reentrant function 'getgrgid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getgrgid_r'. [prohibitedgetgrgidCalled] sockstat/sockstat.c:731:20: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] sockstat/sockstat.c:683:68: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] sockstat/sockstat.c:689:68: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] sockstat/sockstat.c:695:68: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] sockstat/sockstat.c:700:68: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] sockstat/sockstat.c:707:60: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] sockstat/sockstat.c:714:60: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] sockstat/sockstat.c:720:60: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] sockstat/sockstat.c:726:60: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] sockstat/sockstat.c:734:68: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] sockstat/sockstat.c:740:60: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] sockstat/sockstat.c:746:60: style: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] sockstat/sockstat.c:384:8: warning: %x in format string (no. 2) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] sockstat/sockstat.c:384:8: warning: %x in format string (no. 4) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] sockstat/sockstat.c:398:9: warning: %x in format string (no. 17) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] sockstat/sockstat.c:398:9: warning: %x in format string (no. 34) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] sockstat/sockstat.c:443:11: warning: %u in format string (no. 1) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] sockstat/sockstat.c:443:11: warning: %u in format string (no. 2) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] sockstat/sockstat.c:443:11: warning: %u in format string (no. 3) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] sockstat/sockstat.c:443:11: warning: %u in format string (no. 4) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] sockstat/sockstat.c:234:6: warning: sscanf() without field width limits can crash with huge input data. [invalidscanf] sockstat/sockstat.c:443:11: warning: sscanf() without field width limits can crash with huge input data. [invalidscanf] sockstat/sockstat.c:264:7: style: Local variable 'buf' shadows outer variable [shadowVariable] sockstat/sockstat.c:102:6: note: Shadowed declaration sockstat/sockstat.c:264:7: note: Shadow variable sockstat/sockstat.c:281:7: style: Local variable 'buf' shadows outer variable [shadowVariable] sockstat/sockstat.c:102:6: note: Shadowed declaration sockstat/sockstat.c:281:7: note: Shadow variable sockstat/sockstat.c:298:7: style: Local variable 'buf' shadows outer variable [shadowVariable] sockstat/sockstat.c:102:6: note: Shadowed declaration sockstat/sockstat.c:298:7: note: Shadow variable sockstat/sockstat.c:652:19: style: Local variable 'pwd' shadows outer variable [shadowVariable] sockstat/sockstat.c:522:17: note: Shadowed declaration sockstat/sockstat.c:652:19: note: Shadow variable sockstat/sockstat.c:653:18: style: Local variable 'grp' shadows outer variable [shadowVariable] sockstat/sockstat.c:523:16: note: Shadowed declaration sockstat/sockstat.c:653:18: note: Shadow variable sockstat/sockstat.c:155:19: style: Variable 'a_rec' can be declared as pointer to const [constVariablePointer] sockstat/sockstat.c:155:27: style: Variable 'b_rec' can be declared as pointer to const [constVariablePointer] sockstat/sockstat.c:245:46: style: Parameter 'proto' can be declared as pointer to const [constParameterPointer] sockstat/sockstat.c:313:38: style: Parameter 'record' can be declared as pointer to const [constParameterPointer] sockstat/sockstat.c:514:32: style: Parameter 'filename' can be declared as pointer to const [constParameterPointer] sockstat/sockstat.c:522:17: style: Variable 'pwd' can be declared as pointer to const [constVariablePointer] sockstat/sockstat.c:523:16: style: Variable 'grp' can be declared as pointer to const [constVariablePointer] sockstat/sockstat.c:524:17: style: Variable 'procent' can be declared as pointer to const [constVariablePointer] sockstat/sockstat.c:524:27: style: Variable 'fdent' can be declared as pointer to const [constVariablePointer] sockstat/sockstat.c:652:19: style: Variable 'pwd' can be declared as pointer to const [constVariablePointer] sockstat/sockstat.c:489:3: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour. See condition at line 487. [shiftTooManyBitsSigned] sockstat/sockstat.c:487:24: note: Assuming that condition 'port>65535' is not redundant sockstat/sockstat.c:489:3: note: Shift sockstat/sockstat.c:357:6: style: Unused variable: d [unusedVariable] sockstat/sockstat.c:364:9: style: Unused variable: q [unusedVariable] sockstat/sockstat.c:364:13: style: Unused variable: x [unusedVariable] sockstat/sockstat.c:364:17: style: Unused variable: y [unusedVariable] diff: DONE