2025-05-05 09:23 ftp://ftp.de.debian.org/debian/pool/main/k/knockd/knockd_0.8.orig.tar.xz 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 -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: c79862b (2025-05-05 10:59:17 +0200) count: 53 53 elapsed-time: 1.0 1.1 head-timing-info: old-timing-info: head results: knock-0.8/src/knock.c:68:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable no_argument [valueFlowBailoutIncompleteVar] knock-0.8/src/knock.c:179:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] knock-0.8/src/list.c:195:3: warning: If memory allocation fails, then there is a possible null pointer dereference: arr [nullPointerOutOfMemory] knock-0.8/src/list.c:193:23: note: Assuming allocation function fails knock-0.8/src/list.c:193:8: note: Assignment 'arr=(char**)malloc(arrct*sizeof(char*))', assigned value is 0 knock-0.8/src/list.c:195:3: note: Null pointer dereference knock-0.8/src/list.c:198:8: warning: If memory allocation fails, then there is a possible null pointer dereference: arr [nullPointerOutOfMemory] knock-0.8/src/list.c:193:23: note: Assuming allocation function fails knock-0.8/src/list.c:193:8: note: Assignment 'arr=(char**)malloc(arrct*sizeof(char*))', assigned value is 0 knock-0.8/src/list.c:198:8: note: Null pointer dereference knock-0.8/src/list.c:202:28: warning: If memory allocation fails, then there is a possible null pointer dereference: arr [nullPointerOutOfMemory] knock-0.8/src/list.c:193:23: note: Assuming allocation function fails knock-0.8/src/list.c:193:8: note: Assignment 'arr=(char**)malloc(arrct*sizeof(char*))', assigned value is 0 knock-0.8/src/list.c:202:28: note: Null pointer dereference knock-0.8/src/list.c:80:41: style: Parameter 'data' can be declared as pointer to const [constParameterPointer] knock-0.8/src/list.c:112:39: style: Parameter 'needle' can be declared as pointer to const [constParameterPointer] knock-0.8/src/list.c:126:17: style: Parameter 'needle' can be declared as pointer to const [constParameterPointer] knock-0.8/src/list.c:217:8: style: Variable 'cenv' can be declared as pointer to const [constVariablePointer] knock-0.8/src/knock.c:165:3: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] knock-0.8/src/knock.c:113:20: warning: If memory allocation fails, then there is a possible null pointer dereference: arg [nullPointerOutOfMemory] knock-0.8/src/knock.c:111:27: note: Assuming allocation function fails knock-0.8/src/knock.c:111:27: note: Assignment 'arg=strdup(argv[optind])', assigned value is 0 knock-0.8/src/knock.c:113:20: note: Null pointer dereference knock-0.8/src/knock.c:65:8: style: Variable 'hostname' can be declared as pointer to const [constVariablePointer] knock-0.8/src/knock.c:66:23: style: Variable 'opts' can be declared as const array [constVariable] knock-0.8/src/knockd.c:174:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PCAP_ERRBUF_SIZE [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:358:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:369:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:382:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LOG_NOTICE [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:416:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:450:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable WNOHANG [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:570:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PATH_MAX [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:815:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:852:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:869:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PATH_MAX [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:897:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:1023:29: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable IPPROTO_TCP [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:1320:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIOCGIFADDR [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:1408:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:1426:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable IPPROTO_TCP [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:1541:27: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PATH_MAX [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:1627:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable DLT_EN10MB [valueFlowBailoutIncompleteVar] knock-0.8/src/knockd.c:388:8: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] knock-0.8/src/knockd.c:1317:2: style: Obsolescent function 'bzero' called. It is recommended to use 'memset' instead. [prohibitedbzeroCalled] knock-0.8/src/knockd.c:1705:11: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] knock-0.8/src/knockd.c:1847:13: style: Obsolescent function 'gethostbyaddr' called. It is recommended to use 'getnameinfo' instead. [prohibitedgethostbyaddrCalled] knock-0.8/src/knockd.c:1849:13: style: Obsolescent function 'gethostbyaddr' called. It is recommended to use 'getnameinfo' instead. [prohibitedgethostbyaddrCalled] knock-0.8/src/knockd.c:1040:7: style: The if condition is the same as the previous if condition [duplicateCondition] knock-0.8/src/knockd.c:1035:7: note: First condition knock-0.8/src/knockd.c:1040:7: note: Second condition knock-0.8/src/knockd.c:450:53: style: 'continue' is redundant since it is the last statement in a loop. [redundantContinue] knock-0.8/src/knockd.c:177:23: style: Variable 'opts' can be declared as const array [constVariable] knock-0.8/src/knockd.c:386:14: style: Variable 'tm' can be declared as pointer to const [constVariablePointer] knock-0.8/src/knockd.c:397:34: style: Parameter 'door' can be declared as pointer to const [constParameterPointer] knock-0.8/src/knockd.c:567:23: style: Parameter 'configfile' can be declared as pointer to const [constParameterPointer] knock-0.8/src/knockd.c:809:8: style: Variable 'port' can be declared as pointer to const [constVariablePointer] knock-0.8/src/knockd.c:1342:8: style: Variable 'token' can be declared as pointer to const [constVariablePointer] knock-0.8/src/knockd.c:1421:29: style: Parameter 'door' can be declared as pointer to const [constParameterPointer] knock-0.8/src/knockd.c:1421:64: style: Parameter 'tcp' can be declared as pointer to const [constParameterPointer] knock-0.8/src/knockd.c:1499:9: style: Variable 'start_command' can be declared as pointer to const [constVariablePointer] knock-0.8/src/knockd.c:1500:9: style: Variable 'stop_command' can be declared as pointer to const [constVariablePointer] knock-0.8/src/knockd.c:1605:23: style: Variable 'eth' can be declared as pointer to const [constVariablePointer] knock-0.8/src/knockd.c:1609:17: style: Variable 'udp' can be declared as pointer to const [constVariablePointer] knock-0.8/src/knockd.c:1618:13: style: Variable 'pkt_tm' can be declared as pointer to const [constVariablePointer] knock-0.8/src/knockd.c:1832:22: style: Variable 'he' can be declared as pointer to const [constVariablePointer] knock-0.8/src/knockd.c:1871:25: style: Parameter 'ip' can be declared as pointer to const [constParameterPointer] knock-0.8/src/knockd.c:1871:35: style: Parameter 'target' can be declared as pointer to const [constParameterPointer] diff: DONE