2022-06-30 07:40 ftp://ftp.de.debian.org/debian/pool/main/p/plan/plan_1.10.1.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-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: 06b408e (2022-06-29 13:43:17 +0200) count: 68 68 elapsed-time: 41.6 52.9 head-timing-info: Tokenizer::simplifyTokens1: 40.8005s (avg. 0.741828s - 55 result(s)) Tokenizer::simplifyTokens1::ValueFlow: 39.585s (avg. 0.761249s - 52 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 0.644829s (avg. 0.0124006s - 52 result(s)) Tokenizer::createTokens: 0.189594s (avg. 0.00332621s - 57 result(s)) Tokenizer::simplifyTokens1::setValueType: 0.129995s (avg. 0.0024999s - 52 result(s)) Overall time: 81.883s old-timing-info: Tokenizer::simplifyTokens1: 52.0835s (avg. 0.946972s - 55 result(s)) Tokenizer::simplifyTokens1::ValueFlow: 50.7955s (avg. 0.976837s - 52 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 0.689983s (avg. 0.0132689s - 52 result(s)) Tokenizer::createTokens: 0.182825s (avg. 0.00320746s - 57 result(s)) Tokenizer::simplifyTokens1::setValueType: 0.129422s (avg. 0.00248888s - 52 result(s)) Overall time: 104.428s head results: plan-1.10.1/src/adjmenu.c:311:4: style: Variable 'w' is reassigned a value before the old one has been used. [redundantAssignment] plan-1.10.1/src/adjmenu.c:261:4: note: w is assigned plan-1.10.1/src/adjmenu.c:311:4: note: w is overwritten plan-1.10.1/src/adjmenu.c:325:4: style: Variable 'w' is reassigned a value before the old one has been used. [redundantAssignment] plan-1.10.1/src/adjmenu.c:311:4: note: w is assigned plan-1.10.1/src/adjmenu.c:325:4: note: w is overwritten plan-1.10.1/src/convert.c:355:11: style: Condition 'nnum>1' is always true [knownConditionTrueFalse] plan-1.10.1/src/convert.c:348:20: note: Assuming that condition 'nnum<2' is not redundant plan-1.10.1/src/convert.c:355:11: note: Condition 'nnum>1' is always true plan-1.10.1/src/cyccalc.c:266:7: style: Suspicious condition (assignment + comparison); Clarify expression with parentheses. [clarifyCondition] plan-1.10.1/src/cyccalc.c:268:13: style: Suspicious condition (assignment + comparison); Clarify expression with parentheses. [clarifyCondition] plan-1.10.1/src/daemon.c:266:30: error: syntax error: / . pland [syntaxError] plan-1.10.1/src/dbase.c:567:22: error: Array 'list->entry[1]' accessed at index -1, which is out of bounds. [negativeIndex] plan-1.10.1/src/dbase.c:521:21: note: Assignment 'earliest_n=-1', assigned value is -1 plan-1.10.1/src/dbase.c:536:11: note: Assuming condition is false plan-1.10.1/src/dbase.c:567:22: note: Negative array index plan-1.10.1/src/dbase.c:569:23: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition] plan-1.10.1/src/dbase.c:568:32: note: outer condition: earliest_prev_n>=0 plan-1.10.1/src/dbase.c:569:23: note: opposite inner condition: earliest_prev_n==-1 plan-1.10.1/src/dbase.c:531:10: style: Variable 'n' is reassigned a value before the old one has been used. [redundantAssignment] plan-1.10.1/src/dbase.c:528:4: note: n is assigned plan-1.10.1/src/dbase.c:531:10: note: n is overwritten plan-1.10.1/src/excmenu.c:436:4: style: Variable 'w' is reassigned a value before the old one has been used. [redundantAssignment] plan-1.10.1/src/excmenu.c:422:4: note: w is assigned plan-1.10.1/src/excmenu.c:436:4: note: w is overwritten plan-1.10.1/src/excmenu.c:138:37: style: Unused variable: popup [unusedVariable] plan-1.10.1/src/excmenu.c:142:12: style: Unused variable: str [unusedVariable] plan-1.10.1/src/file_r.c:250:17: debug: Wrong data detected by condition !tok->next()->astOperand1() [DacaWrongData] plan-1.10.1/src/file_r.c:668:8: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] plan-1.10.1/src/file_r.c:473:3: warning: sscanf() without field width limits can crash with huge input data. [invalidscanf] plan-1.10.1/src/g_dbase.c:216:9: error: Common realloc mistake: 'row' nulled but not freed upon failure [memleakOnRealloc] plan-1.10.1/src/g_dbfile.c:296:15: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [prohibitedreaddirCalled] plan-1.10.1/src/g_dbfile.c:354:29: error: Resource handle 'fp' freed twice. [doubleFree] plan-1.10.1/src/g_dbfile.c:354:16: note: Resource handle 'fp' freed twice. plan-1.10.1/src/g_dbfile.c:354:29: note: Resource handle 'fp' freed twice. plan-1.10.1/src/g_dbfile.c:102:9: warning: Either the condition 'sect' is redundant or there is possible null pointer dereference: sect. [nullPointerRedundantCheck] plan-1.10.1/src/g_dbfile.c:180:6: note: Assuming that condition 'sect' is not redundant plan-1.10.1/src/g_dbfile.c:102:9: note: Null pointer dereference plan-1.10.1/src/g_dbfile.c:183:2: warning: Either the condition 'sect' is redundant or there is possible null pointer dereference: sect. [nullPointerRedundantCheck] plan-1.10.1/src/g_dbfile.c:180:6: note: Assuming that condition 'sect' is not redundant plan-1.10.1/src/g_dbfile.c:183:2: note: Null pointer dereference plan-1.10.1/src/g_dbfile.c:363:41: style: Argument '(bsize=1024)*sizeof(char)' to function malloc is always 1024. It does not matter what value 'bsize' has. [knownArgument] plan-1.10.1/src/g_dbfile.c:96:8: style: Variable 'buf' is not assigned a value. [unassignedVariable] plan-1.10.1/src/g_formop.c:527:15: style: Variable 'item->column' is reassigned a value before the old one has been used. [redundantAssignment] plan-1.10.1/src/g_formop.c:491:22: note: item->column is assigned plan-1.10.1/src/g_formop.c:527:15: note: item->column is overwritten plan-1.10.1/src/help.c:226:3: error: Resource leak: fp [resourceLeak] plan-1.10.1/src/help.c:252:10: error: Common realloc mistake: 'text' nulled but not freed upon failure [memleakOnRealloc] plan-1.10.1/src/help.c:216:39: style: Argument 'textsize=4096' to function malloc is always 4096. It does not matter what value 'textsize' has. [knownArgument] plan-1.10.1/src/holiday.c:371:47: warning: Either the condition 'julian>=0' is redundant or the array 'sm_holiday[366]' is accessed at index -1, which is out of bounds. [negativeIndex] plan-1.10.1/src/holiday.c:374:13: note: Assuming that condition 'julian>=0' is not redundant plan-1.10.1/src/holiday.c:371:47: note: Negative array index plan-1.10.1/src/holiday.c:372:16: warning: Either the condition 'julian>=0' is redundant or the array 'holiday[366]' is accessed at index -1, which is out of bounds. [negativeIndex] plan-1.10.1/src/holiday.c:374:13: note: Assuming that condition 'julian>=0' is not redundant plan-1.10.1/src/holiday.c:372:16: note: Negative array index plan-1.10.1/src/holiday.c:246:7: warning: Function 'setdoff' argument order different: declaration 'rel, wday, month, day, year, off, length' definition 'wday, rel, month, day, year, off, length' [funcArgOrderDifferent] plan-1.10.1/src/proto.h:201:7: note: Function 'setdoff' argument order different: declaration 'rel, wday, month, day, year, off, length' definition 'wday, rel, month, day, year, off, length' plan-1.10.1/src/holiday.c:246:7: note: Function 'setdoff' argument order different: declaration 'rel, wday, month, day, year, off, length' definition 'wday, rel, month, day, year, off, length' plan-1.10.1/src/language.c:191:14: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [prohibitedreaddirCalled] plan-1.10.1/src/language.c:127:3: error: Memory leak: file [memleak] plan-1.10.1/src/main.c:456:34: error: syntax error: / . plan [syntaxError] plan-1.10.1/src/mondraw.c:97:13: style: Variable 'tm.tm_mday' is assigned a value that is never used. [unreadVariable] plan-1.10.1/src/netplan_if.h:35:0: error: #error Use -DLIB="/usr/local/lib" when compiling, see Makefile [preprocessorErrorDirective] plan-1.10.1/src/netplan_acl.c:181:14: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] plan-1.10.1/src/netplan_acl.c:189:14: portability: Non reentrant function 'getgrnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getgrnam_r'. [prohibitedgetgrnamCalled] plan-1.10.1/src/netplan_acl.c:197:14: style: Obsolescent function 'gethostbyname' called. It is recommended to use 'getaddrinfo' instead. [prohibitedgethostbynameCalled] plan-1.10.1/src/netplan_acl.c:210:20: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] plan-1.10.1/src/netplan_acl.c:218:19: style: Obsolescent function 'gethostbyname' called. It is recommended to use 'getaddrinfo' instead. [prohibitedgethostbynameCalled] plan-1.10.1/src/netplan_acl.c:536:25: portability: Non reentrant function 'getservbyname' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getservbyname_r'. [prohibitedgetservbynameCalled] plan-1.10.1/src/netplan_acl.c:465:9: style: Suspicious condition (assignment + comparison); Clarify expression with parentheses. [clarifyCondition] plan-1.10.1/src/netplan_acl.c:407:2: warning: %d in format string (no. 1) requires 'int *' but the argument type is 'unsigned int *'. [invalidScanfArgType_int] plan-1.10.1/src/netplan_acl.c:407:2: warning: %d in format string (no. 2) requires 'int *' but the argument type is 'unsigned int *'. [invalidScanfArgType_int] plan-1.10.1/src/netplan_acl.c:407:2: warning: %d in format string (no. 3) requires 'int *' but the argument type is 'unsigned int *'. [invalidScanfArgType_int] plan-1.10.1/src/netplan_acl.c:407:2: warning: %d in format string (no. 4) requires 'int *' but the argument type is 'unsigned int *'. [invalidScanfArgType_int] plan-1.10.1/src/netplan_acl.c:417:2: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] plan-1.10.1/src/netplan_acl.c:417:2: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] plan-1.10.1/src/netplan_acl.c:417:2: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] plan-1.10.1/src/netplan_acl.c:417:2: warning: %d in format string (no. 4) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] plan-1.10.1/src/netplan_acl.c:271:31: style: Argument 'sizeof(ugid)*(acl->maxdata=16)' to function allocate is always 64. It does not matter what value 'acl->maxdata' has. [knownArgument] plan-1.10.1/src/netplan_acl.c:274:31: style: Argument 'sizeof(host)*(acl->maxdata=16)' to function allocate is always 64. It does not matter what value 'acl->maxdata' has. [knownArgument] plan-1.10.1/src/print.c:706:8: style: Local variable 'color' shadows outer variable [shadowVariable] plan-1.10.1/src/print.c:64:15: note: Shadowed declaration plan-1.10.1/src/print.c:706:8: note: Shadow variable plan-1.10.1/src/time.c:403:9: warning: Uninitialized variable: julian [uninitvar] plan-1.10.1/src/time.c:362:10: note: Assuming condition is false plan-1.10.1/src/time.c:403:9: note: Uninitialized variable: julian plan-1.10.1/src/time.c:181:18: style: Variable 'dst' is assigned a value that is never used. [unreadVariable] plan-1.10.1/src/time.c:196:8: style: Variable 'dst' is assigned a value that is never used. [unreadVariable] plan-1.10.1/src/usermenu.c:642:25: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] plan-1.10.1/src/usermenu.c:774:7: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] plan-1.10.1/src/usermenu.c:487:19: error: Common realloc mistake: 'utable' nulled but not freed upon failure [memleakOnRealloc] plan-1.10.1/src/usermenu.c:735:18: error: Common realloc mistake: 'user' nulled but not freed upon failure [memleakOnRealloc] plan-1.10.1/src/usermenu.c:876:14: error: Common realloc mistake: 'user' nulled but not freed upon failure [memleakOnRealloc] plan-1.10.1/src/usermenu.c:464:11: style: Unused variable: w [unusedVariable] plan-1.10.1/src/util.c:183:34: error: syntax error: / . pland [syntaxError] plan-1.10.1/src/vcalendar_w.c:60:46: warning: Found calculation inside sizeof(). [sizeofCalculation] plan-1.10.1/src/vcalendar_w.c:65:20: warning: Found calculation inside sizeof(). [sizeofCalculation] plan-1.10.1/src/weekdraw.c:335:8: style: Variable 'i' is reassigned a value before the old one has been used. [redundantAssignment] plan-1.10.1/src/weekdraw.c:321:4: note: i is assigned plan-1.10.1/src/weekdraw.c:335:8: note: i is overwritten plan-1.10.1/src/weekdraw.c:380:9: style: Local variable 'buf' shadows outer variable [shadowVariable] plan-1.10.1/src/weekdraw.c:291:8: note: Shadowed declaration plan-1.10.1/src/weekdraw.c:380:9: note: Shadow variable plan-1.10.1/src/yovdraw.c:313:4: style: Variable 'i' is assigned a value that is never used. [unreadVariable] plan-1.10.1/src/yovmenu.c:309:8: style: Variable 'below' is reassigned a value before the old one has been used. [redundantAssignment] plan-1.10.1/src/yovmenu.c:199:8: note: below is assigned plan-1.10.1/src/yovmenu.c:309:8: note: below is overwritten diff: 2.8 plan-1.10.1/src/time.c:403:9: error: Uninitialized variable: julian [uninitvar] plan-1.10.1/src/time.c:362:10: note: Assuming condition is false plan-1.10.1/src/time.c:403:9: note: Uninitialized variable: julian head plan-1.10.1/src/time.c:403:9: warning: Uninitialized variable: julian [uninitvar] plan-1.10.1/src/time.c:362:10: note: Assuming condition is false plan-1.10.1/src/time.c:403:9: note: Uninitialized variable: julian DONE