2022-06-21 22:53 ftp://ftp.de.debian.org/debian/pool/main/f/fwlogwatch/fwlogwatch_1.4.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 -j1 platform: Linux-5.4.0-120-generic-x86_64-with-glibc2.29 python: 3.8.10 client-version: 1.3.24 compiler: g++ (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0 cppcheck: head 2.8 head-info: 10c7c70 (2022-06-22 00:03:18 +0200) count: 57 57 elapsed-time: 42.0 94.2 head-timing-info: Tokenizer::simplifyTokens1: 13.7171s (avg. 1.14309s - 12 result(s)) Tokenizer::simplifyTokens1::ValueFlow: 13.5039s (avg. 1.12532s - 12 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 0.127216s (avg. 0.0106013s - 12 result(s)) Tokenizer::createTokens: 0.030463s (avg. 0.00253858s - 12 result(s)) Tokenizer::simplifyTokens1::setValueType: 0.029906s (avg. 0.00249217s - 12 result(s)) Overall time: 27.5048s old-timing-info: Tokenizer::simplifyTokens1: 30.9209s (avg. 2.57674s - 12 result(s)) Tokenizer::simplifyTokens1::ValueFlow: 30.6898s (avg. 2.55748s - 12 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 0.139844s (avg. 0.0116537s - 12 result(s)) Tokenizer::simplifyTokens1::setValueType: 0.030301s (avg. 0.00252508s - 12 result(s)) Tokenizer::createTokens: 0.029779s (avg. 0.00248158s - 12 result(s)) Overall time: 61.905s head results: fwlogwatch-1.4/compare.c:382:49: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/compare.c:384:49: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/compare.c:213:7: warning: Possible null pointer dereference: tail [nullPointer] fwlogwatch-1.4/compare.c:173:21: note: Assignment 'tail=NULL', assigned value is 0 fwlogwatch-1.4/compare.c:213:7: note: Null pointer dereference fwlogwatch-1.4/compare.c:195:29: style: Checking if unsigned expression 'compare(p,q)' is less than zero. [unsignedLessThanZero] fwlogwatch-1.4/compare.c:164:55: style:inconclusive: Function 'fwlw_pc_mergesort' argument 1 names different: declaration 'list1' definition 'list'. [funcArgNamesDifferent] fwlogwatch-1.4/compare.h:9:55: note: Function 'fwlw_pc_mergesort' argument 1 names different: declaration 'list1' definition 'list'. fwlogwatch-1.4/compare.c:164:55: note: Function 'fwlw_pc_mergesort' argument 1 names different: declaration 'list1' definition 'list'. fwlogwatch-1.4/modes.c:193:58: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/modes.c:200:57: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/modes.c:246:58: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/modes.c:249:14: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] fwlogwatch-1.4/modes.c:663:11: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] fwlogwatch-1.4/modes.c:815:52: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/modes.c:817:52: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/modes.c:599:3: error: Resource leak: retval [resourceLeak] fwlogwatch-1.4/modes.c:670:21: warning: Either the condition 'pwe==NULL' is redundant or there is possible null pointer dereference: pwe. [nullPointerRedundantCheck] fwlogwatch-1.4/modes.c:664:13: note: Assuming that condition 'pwe==NULL' is not redundant fwlogwatch-1.4/modes.c:670:21: note: Null pointer dereference fwlogwatch-1.4/modes.c:718:10: style: Local variable 'first' shadows outer variable [shadowVariable] fwlogwatch-1.4/modes.c:39:26: note: Shadowed declaration fwlogwatch-1.4/modes.c:718:10: note: Shadow variable fwlogwatch-1.4/modes.c:49:19: style: Variable 'hit' is assigned a value that is never used. [unreadVariable] fwlogwatch-1.4/modes.c:715:14: style: Variable 'retval' is assigned a value that is never used. [unreadVariable] fwlogwatch-1.4/net.c:52:3: style: Obsolescent function 'bzero' called. It is recommended to use 'memset' instead. [prohibitedbzeroCalled] fwlogwatch-1.4/net.c:90:3: style: Obsolescent function 'bzero' called. It is recommended to use 'memset' instead. [prohibitedbzeroCalled] fwlogwatch-1.4/net.c:341:60: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/net.c:344:60: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/net.c:419:51: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/net.c:528:51: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/net.c:664:8: portability: Non reentrant function 'crypt' called. For threadsafe applications it is recommended to use the reentrant replacement function 'crypt_r'. [prohibitedcryptCalled] fwlogwatch-1.4/net.c:93:21: error: Uninitialized variable: in6a [uninitvar] fwlogwatch-1.4/output.c:106:51: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/output.c:113:53: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/output.c:193:51: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/output.c:202:53: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/output.c:380:49: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/output.c:97:3: style:inconclusive: Found duplicate branches for 'if' and 'else'. [duplicateBranch] fwlogwatch-1.4/output.c:99:5: note: Found duplicate branches for 'if' and 'else'. fwlogwatch-1.4/output.c:97:3: note: Found duplicate branches for 'if' and 'else'. fwlogwatch-1.4/output.c:190:17: style: Local variable 'first' shadows outer variable [shadowVariable] fwlogwatch-1.4/output.c:19:26: note: Shadowed declaration fwlogwatch-1.4/output.c:190:17: note: Shadow variable fwlogwatch-1.4/parser.c:36:11: error: Width 32 given in format string (no. 4) is larger than destination buffer 'name[32]', use %31s to prevent overflowing it. [invalidScanfFormatWidth] fwlogwatch-1.4/parser.c:36:11: error: Width 1024 given in format string (no. 5) is larger than destination buffer 'rest[1024]', use %1023s to prevent overflowing it. [invalidScanfFormatWidth] fwlogwatch-1.4/resolve.c:41:14: portability: Non reentrant function 'getprotobynumber' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getprotobynumber_r'. [prohibitedgetprotobynumberCalled] fwlogwatch-1.4/resolve.c:58:13: portability: Non reentrant function 'getservbyport' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getservbyport_r'. [prohibitedgetservbyportCalled] fwlogwatch-1.4/response.c:41:14: error: Width 10 given in format string (no. 1) is larger than destination buffer 'chain[10]', use %9s to prevent overflowing it. [invalidScanfFormatWidth] fwlogwatch-1.4/response.c:41:14: error: Width 36 given in format string (no. 2) is larger than destination buffer 'src_dst[36]', use %35s to prevent overflowing it. [invalidScanfFormatWidth] fwlogwatch-1.4/response.c:41:14: error: Width 16 given in format string (no. 3) is larger than destination buffer 'interface[16]', use %15s to prevent overflowing it. [invalidScanfFormatWidth] fwlogwatch-1.4/response.c:41:14: error: Width 80 given in format string (no. 7) is larger than destination buffer 'rest[80]', use %79s to prevent overflowing it. [invalidScanfFormatWidth] fwlogwatch-1.4/response.c:83:7: error: Memory pointed to by 'buf' is freed twice. [doubleFree] fwlogwatch-1.4/response.c:76:5: note: Memory pointed to by 'buf' is freed twice. fwlogwatch-1.4/response.c:83:7: note: Memory pointed to by 'buf' is freed twice. fwlogwatch-1.4/response.c:88:3: error: Memory pointed to by 'buf' is freed twice. [doubleFree] fwlogwatch-1.4/response.c:76:5: note: Memory pointed to by 'buf' is freed twice. fwlogwatch-1.4/response.c:88:3: note: Memory pointed to by 'buf' is freed twice. fwlogwatch-1.4/response.c:40:30: warning: Either the condition 'fd==NULL' is redundant or there is possible null pointer dereference: fd. [nullPointerRedundantCheck] fwlogwatch-1.4/response.c:35:10: note: Assuming that condition 'fd==NULL' is not redundant fwlogwatch-1.4/response.c:40:30: note: Null pointer dereference fwlogwatch-1.4/response.c:443:2: warning: Possible null pointer dereference: tail [nullPointer] fwlogwatch-1.4/response.c:403:16: note: Assignment 'tail=NULL', assigned value is 0 fwlogwatch-1.4/response.c:443:2: note: Null pointer dereference fwlogwatch-1.4/response.c:425:34: style: Checking if unsigned expression 'hs_compare(p,q)' is less than zero. [unsignedLessThanZero] fwlogwatch-1.4/utils.c:207:9: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/utils.c:212:9: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/utils.c:517:46: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] fwlogwatch-1.4/utils.c:35:10: style: Checking if unsigned expression 'n' is less than zero. [unsignedLessThanZero] fwlogwatch-1.4/whois.c:40:9: warning: Either the condition 'cnt<32' is redundant or the array 'buffer[32]' is accessed at index 32, which is out of bounds. [arrayIndexOutOfBoundsCond] fwlogwatch-1.4/whois.c:35:44: note: Assuming that condition 'cnt<32' is not redundant fwlogwatch-1.4/whois.c:40:9: note: Array index out of bounds fwlogwatch-1.4/whois.c:62:3: style: Obsolescent function 'bzero' called. It is recommended to use 'memset' instead. [prohibitedbzeroCalled] fwlogwatch-1.4/whois.c:252:8: style: Obsolescent function 'gethostbyname' called. It is recommended to use 'getaddrinfo' instead. [prohibitedgethostbynameCalled] fwlogwatch-1.4/whois.c:266:3: style: Obsolescent function 'bcopy' called. It is recommended to use 'memcpy' or 'memmove' instead. [prohibitedbcopyCalled] fwlogwatch-1.4/whois.c:150:16: warning: Either the condition 'desce!=NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck] fwlogwatch-1.4/whois.c:146:12: note: Assuming that condition 'desce!=NULL' is not redundant fwlogwatch-1.4/whois.c:150:16: note: Null pointer addition fwlogwatch-1.4/whois.c:160:16: warning: Either the condition 'desce!=NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck] fwlogwatch-1.4/whois.c:156:12: note: Assuming that condition 'desce!=NULL' is not redundant fwlogwatch-1.4/whois.c:160:16: note: Null pointer addition fwlogwatch-1.4/whois.c:170:16: warning: Either the condition 'desce!=NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck] fwlogwatch-1.4/whois.c:166:12: note: Assuming that condition 'desce!=NULL' is not redundant fwlogwatch-1.4/whois.c:170:16: note: Null pointer addition fwlogwatch-1.4/whois.c:210:25: error: Signed integer overflow for expression '255<<24'. [integerOverflow] diff: DONE