2022-06-23 20:15 ftp://ftp.de.debian.org/debian/pool/main/n/nagios-nrpe/nagios-nrpe_4.0.3.orig.tar.gz cppcheck-options: --library=posix --library=gnu --showtime=top5 --check-library --inconclusive --enable=style,information --template=daca2 -D__GNUC__ --platform=unix64 -rp=temp -j2 platform: Linux-5.4.0-110-generic-x86_64-with-glibc2.29 python: 3.8.10 client-version: 1.3.24 compiler: g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 cppcheck: head 2.8 head-info: 60c1eef (2022-06-23 20:26:47 +0200) count: 77 77 elapsed-time: 4.3 6.9 head-timing-info: Overall time: 0s old-timing-info: Overall time: 0s head results: nrpe-nrpe-4.0.3/src/acl.c:638:8: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/src/acl.c:673:9: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/src/acl.c:238:26: portability: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS] nrpe-nrpe-4.0.3/src/acl.c:238:26: warning: Shifting 32-bit value by 32 bits is undefined behaviour. See condition at line 231. [shiftTooManyBits] nrpe-nrpe-4.0.3/src/acl.c:231:21: note: Assuming that condition 'data[4]<0' is not redundant nrpe-nrpe-4.0.3/src/acl.c:238:26: note: Shift nrpe-nrpe-4.0.3/src/acl.c:576:34: style: Variable 'resolved' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/acl.c:625:20: style: Variable 'add_to_acl' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/acl.c:621:8: style: Unused variable: saveptr [unusedVariable] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:52:28: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:53:25: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:56:28: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:59:22: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:60:33: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:63:24: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:65:31: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:93:30: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:94:27: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:97:30: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:100:24: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:101:35: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:104:26: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/contrib/nrpe_check_control.c:106:33: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/src/check_nrpe.c:668:19: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/src/check_nrpe.c:672:19: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/src/check_nrpe.c:674:19: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/src/check_nrpe.c:1428:6: portability: %ld in format string (no. 2) requires 'long' but the argument type is 'size_t {aka unsigned long}'. [invalidPrintfArgType_sint] nrpe-nrpe-4.0.3/src/check_nrpe.c:1503:5: portability: %ld in format string (no. 2) requires 'long' but the argument type is 'size_t {aka unsigned long}'. [invalidPrintfArgType_sint] nrpe-nrpe-4.0.3/src/check_nrpe.c:1333:23: warning: Either the condition 'v3_receive_packet' is redundant or there is possible null pointer dereference: v3_receive_packet. [nullPointerRedundantCheck] nrpe-nrpe-4.0.3/src/check_nrpe.c:1337:8: note: Assuming that condition 'v3_receive_packet' is not redundant nrpe-nrpe-4.0.3/src/check_nrpe.c:1333:23: note: Null pointer dereference nrpe-nrpe-4.0.3/src/check_nrpe.c:1264:6: error: Uninitialized variable: rc [uninitvar] nrpe-nrpe-4.0.3/src/check_nrpe.c:1247:14: note: Assuming condition is false nrpe-nrpe-4.0.3/src/check_nrpe.c:1264:6: note: Uninitialized variable: rc nrpe-nrpe-4.0.3/src/check_nrpe.c:215:8: style: Variable 'c' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/check_nrpe.c:585:10: style: Variable 'sz' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/check_nrpe.c:1059:41: style: Variable 'nerrs' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/check_nrpe.c:1067:5: style: Variable 'rc' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/check_nrpe.c:1059:18: style: Unused variable: ssl_err [unusedVariable] nrpe-nrpe-4.0.3/src/check_nrpe.c:1059:27: style: Unused variable: ern [unusedVariable] nrpe-nrpe-4.0.3/src/check_nrpe.c:1059:32: style: Unused variable: x [unusedVariable] nrpe-nrpe-4.0.3/src/check_nrpe.c:1415:83: style: Variable 'bytes_read' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/snprintf.c:746:19: style: Condition 'maxlen>0' is always true [knownConditionTrueFalse] nrpe-nrpe-4.0.3/src/snprintf.c:743:13: note: Assuming that condition 'maxlen!=0' is not redundant nrpe-nrpe-4.0.3/src/snprintf.c:746:19: note: Condition 'maxlen>0' is always true nrpe-nrpe-4.0.3/src/snprintf.c:1030:5: style: Condition 'caps' is always false [knownConditionTrueFalse] nrpe-nrpe-4.0.3/src/snprintf.c:966:13: note: Assignment 'caps=0', assigned value is 0 nrpe-nrpe-4.0.3/src/snprintf.c:1030:5: note: Condition 'caps' is always false nrpe-nrpe-4.0.3/src/snprintf.c:1045:5: style: Condition 'caps' is always false [knownConditionTrueFalse] nrpe-nrpe-4.0.3/src/snprintf.c:966:13: note: Assignment 'caps=0', assigned value is 0 nrpe-nrpe-4.0.3/src/snprintf.c:1045:5: note: Condition 'caps' is always false nrpe-nrpe-4.0.3/src/snprintf.c:275:2: error: va_list 'args' used before va_start() was called. [va_list_usedBeforeStarted] nrpe-nrpe-4.0.3/src/snprintf.c:1229:2: error: va_list 'ap2' used before va_start() was called. [va_list_usedBeforeStarted] nrpe-nrpe-4.0.3/src/snprintf.c:1231:35: error: va_list 'ap2' used before va_start() was called. [va_list_usedBeforeStarted] nrpe-nrpe-4.0.3/src/utils.c:273:3: warning: Return value of function asprintf() is not used. [ignoredReturnValue] nrpe-nrpe-4.0.3/src/utils.c:275:3: warning: Return value of function asprintf() is not used. [ignoredReturnValue] nrpe-nrpe-4.0.3/src/utils.c:334:25: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] nrpe-nrpe-4.0.3/src/utils.c:338:25: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] nrpe-nrpe-4.0.3/src/utils.c:418:2: style: Obsolescent function 'bzero' called. It is recommended to use 'memset' instead. [prohibitedbzeroCalled] nrpe-nrpe-4.0.3/src/utils.c:308:4: error: Common realloc mistake: 'var' nulled but not freed upon failure [memleakOnRealloc] nrpe-nrpe-4.0.3/src/utils.c:337:27: error: Uninitialized variable: pw [legacyUninitvar] nrpe-nrpe-4.0.3/src/nrpe.c:245:2: warning: Return value of function asprintf() is not used. [ignoredReturnValue] nrpe-nrpe-4.0.3/src/nrpe.c:247:2: warning: Return value of function asprintf() is not used. [ignoredReturnValue] nrpe-nrpe-4.0.3/src/nrpe.c:875:13: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/src/nrpe.c:883:14: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/src/nrpe.c:941:18: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/src/nrpe.c:942:18: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] nrpe-nrpe-4.0.3/src/nrpe.c:1147:20: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [prohibitedreaddirCalled] nrpe-nrpe-4.0.3/src/nrpe.c:2514:26: portability: Non reentrant function 'getgrnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getgrnam_r'. [prohibitedgetgrnamCalled] nrpe-nrpe-4.0.3/src/nrpe.c:2538:26: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] nrpe-nrpe-4.0.3/src/nrpe.c:2929:45: style: Condition 'selected_macro==NULL' is always false [knownConditionTrueFalse] nrpe-nrpe-4.0.3/src/nrpe.c:1326:3: error: Resource leak: listen_sock [resourceLeak] nrpe-nrpe-4.0.3/src/nrpe.c:627:2: error: Return value of allocation function 'open' is not stored. [leakReturnValNotUsed] nrpe-nrpe-4.0.3/src/nrpe.c:690:2: error: Return value of allocation function 'open' is not stored. [leakReturnValNotUsed] nrpe-nrpe-4.0.3/src/nrpe.c:691:2: error: Return value of allocation function 'open' is not stored. [leakReturnValNotUsed] nrpe-nrpe-4.0.3/src/nrpe.c:692:2: error: Return value of allocation function 'open' is not stored. [leakReturnValNotUsed] nrpe-nrpe-4.0.3/src/nrpe.c:942:16: style: Variable 'temp_buffer' is reassigned a value before the old one has been used. [redundantAssignment] nrpe-nrpe-4.0.3/src/nrpe.c:941:16: note: temp_buffer is assigned nrpe-nrpe-4.0.3/src/nrpe.c:942:16: note: temp_buffer is overwritten nrpe-nrpe-4.0.3/src/nrpe.c:1895:12: style: Variable 'pkt_size' is reassigned a value before the old one has been used. [redundantAssignment] nrpe-nrpe-4.0.3/src/nrpe.c:1889:11: note: pkt_size is assigned nrpe-nrpe-4.0.3/src/nrpe.c:1895:12: note: pkt_size is overwritten nrpe-nrpe-4.0.3/src/nrpe.c:835:12: style: Local variable 'config_file' shadows outer variable [shadowVariable] nrpe-nrpe-4.0.3/src/nrpe.c:86:11: note: Shadowed declaration nrpe-nrpe-4.0.3/src/nrpe.c:835:12: note: Shadow variable nrpe-nrpe-4.0.3/src/nrpe.c:1126:12: style: Local variable 'config_file' shadows outer variable [shadowVariable] nrpe-nrpe-4.0.3/src/nrpe.c:86:11: note: Shadowed declaration nrpe-nrpe-4.0.3/src/nrpe.c:1126:12: note: Shadow variable nrpe-nrpe-4.0.3/src/nrpe.c:2341:14: style: Local variable 'output_size' shadows outer variable [shadowVariable] nrpe-nrpe-4.0.3/src/nrpe.c:2303:12: note: Shadowed declaration nrpe-nrpe-4.0.3/src/nrpe.c:2341:14: note: Shadow variable nrpe-nrpe-4.0.3/src/nrpe.c:169:12: style: Unused variable: y [unusedVariable] nrpe-nrpe-4.0.3/src/nrpe.c:842:16: style: Variable 'len' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/nrpe.c:843:14: style: Variable 'x' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/nrpe.c:833:14: style: Unused variable: st [unusedVariable] nrpe-nrpe-4.0.3/src/nrpe.c:2578:19: style: Variable 'result' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/nrpe.c:2579:16: style: Variable 'pid' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/nrpe.c:2883:22: style: Variable 'arg_index' is assigned a value that is never used. [unreadVariable] nrpe-nrpe-4.0.3/src/nrpe.c:2946:14: style: Variable 'c' is assigned a value that is never used. [unreadVariable] diff: DONE