2022-06-24 01:04 ftp://ftp.de.debian.org/debian/pool/main/n/nss-pam-ldapd/nss-pam-ldapd_0.9.12.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-121-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: 60c1eef (2022-06-23 20:26:47 +0200) count: 104 104 elapsed-time: 17.9 27.4 head-timing-info: Tokenizer::simplifyTokens1: 5.45071s (avg. 0.0801575s - 68 result(s)) Tokenizer::simplifyTokens1::ValueFlow: 5.01164s (avg. 0.0982675s - 51 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 0.22387s (avg. 0.00438961s - 51 result(s)) Tokenizer::createTokens: 0.119872s (avg. 0.00173728s - 69 result(s)) Tokenizer::simplifyTokens1::setValueType: 0.05851s (avg. 0.00114725s - 51 result(s)) Overall time: 11.0833s old-timing-info: Tokenizer::simplifyTokens1: 8.4929s (avg. 0.124896s - 68 result(s)) Tokenizer::simplifyTokens1::ValueFlow: 8.04643s (avg. 0.157773s - 51 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 0.220718s (avg. 0.0043278s - 51 result(s)) Tokenizer::createTokens: 0.128272s (avg. 0.00185901s - 69 result(s)) Tokenizer::simplifyTokens1::setValueType: 0.060849s (avg. 0.00119312s - 51 result(s)) Overall time: 17.203s head results: nss-pam-ldapd-0.9.12/common/expr.c:227:15: style: Checking if unsigned expression 'buflen' is less than zero. [unsignedLessThanZero] nss-pam-ldapd-0.9.12/common/expr.c:328:45: style:inconclusive: Function 'expr_parse' argument 1 names different: declaration 'expr' definition 'str'. [funcArgNamesDifferent] nss-pam-ldapd-0.9.12/common/expr.h:34:45: note: Function 'expr_parse' argument 1 names different: declaration 'expr' definition 'str'. nss-pam-ldapd-0.9.12/common/expr.c:328:45: note: Function 'expr_parse' argument 1 names different: declaration 'expr' definition 'str'. nss-pam-ldapd-0.9.12/common/expr.c:336:28: style:inconclusive: Function 'expr_vars' argument 1 names different: declaration 'expr' definition 'str'. [funcArgNamesDifferent] nss-pam-ldapd-0.9.12/common/expr.h:39:28: note: Function 'expr_vars' argument 1 names different: declaration 'expr' definition 'str'. nss-pam-ldapd-0.9.12/common/expr.c:336:28: note: Function 'expr_vars' argument 1 names different: declaration 'expr' definition 'str'. nss-pam-ldapd-0.9.12/compat/pagectrl.c:153:33: style: Parameter 'ld' can be declared as pointer to const [constParameter] nss-pam-ldapd-0.9.12/nslcd/alias.c:123:1: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nslcd/attmap.c:268:35: style: Checking if unsigned expression 'buflen' is less than zero. [unsignedLessThanZero] nss-pam-ldapd-0.9.12/nslcd/cfg.c:289:13: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] nss-pam-ldapd-0.9.12/nslcd/cfg.c:299:11: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] nss-pam-ldapd-0.9.12/nslcd/cfg.c:330:11: portability: Non reentrant function 'getgrnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getgrnam_r'. [prohibitedgetgrnamCalled] nss-pam-ldapd-0.9.12/nslcd/cfg.c:968:23: portability: Non reentrant function 'getpwent' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwent_r'. [prohibitedgetpwentCalled] nss-pam-ldapd-0.9.12/nslcd/cfg.c:987:17: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] nss-pam-ldapd-0.9.12/nslcd/common.c:136:10: style: Obsolescent function 'gethostbyname' called. It is recommended to use 'getaddrinfo' instead. [prohibitedgethostbynameCalled] nss-pam-ldapd-0.9.12/nslcd/common.c:214:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/common.c:254:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/config.c:38:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/daemonize.c:64:9: error: Return value of allocation function 'open' is not stored. [leakReturnValNotUsed] nss-pam-ldapd-0.9.12/nslcd/ether.c:172:1: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nslcd/group.c:431:1: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nslcd/host.c:155:1: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nslcd/myldap.c:188:21: style: Condition 'msg_diag==NULL' is always true [knownConditionTrueFalse] nss-pam-ldapd-0.9.12/nslcd/myldap.c:165:20: note: Assignment 'msg_diag=NULL', assigned value is 0 nss-pam-ldapd-0.9.12/nslcd/myldap.c:188:21: note: Condition 'msg_diag==NULL' is always true nss-pam-ldapd-0.9.12/nslcd/myldap.c:191:16: style: Condition 'msg_diag!=NULL' is always false [knownConditionTrueFalse] nss-pam-ldapd-0.9.12/nslcd/myldap.c:165:20: note: Assignment 'msg_diag=NULL', assigned value is 0 nss-pam-ldapd-0.9.12/nslcd/myldap.c:191:16: note: Condition 'msg_diag!=NULL' is always false nss-pam-ldapd-0.9.12/nslcd/myldap.c:2522:25: style: Condition 'msg_diag!=NULL' is always false [knownConditionTrueFalse] nss-pam-ldapd-0.9.12/nslcd/myldap.c:2507:20: note: Assignment 'msg_diag=NULL', assigned value is 0 nss-pam-ldapd-0.9.12/nslcd/myldap.c:2508:45: note: Assuming condition is false nss-pam-ldapd-0.9.12/nslcd/myldap.c:2522:25: note: Condition 'msg_diag!=NULL' is always false nss-pam-ldapd-0.9.12/nslcd/myldap.c:2525:16: style: Condition 'msg_diag!=NULL' is always false [knownConditionTrueFalse] nss-pam-ldapd-0.9.12/nslcd/myldap.c:2507:20: note: Assignment 'msg_diag=NULL', assigned value is 0 nss-pam-ldapd-0.9.12/nslcd/myldap.c:2508:45: note: Assuming condition is false nss-pam-ldapd-0.9.12/nslcd/myldap.c:2525:16: note: Condition 'msg_diag!=NULL' is always false nss-pam-ldapd-0.9.12/nslcd/myldap.c:2508:56: style: Checking if unsigned expression 'buflen' is less than zero. [unsignedLessThanZero] nss-pam-ldapd-0.9.12/nslcd/myldap.c:2504:42: style: Parameter 'session' can be declared as pointer to const [constParameter] nss-pam-ldapd-0.9.12/nslcd/myldap.c:668:7: style: Unused variable: rc [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/myldap.c:906:13: style: Variable 'tv.tv_sec' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nslcd/myldap.c:907:14: style: Variable 'tv.tv_usec' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nslcd/myldap.c:1300:17: style: Variable 'sleeptime' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nslcd/myldap.c:2402:7: style: Unused variable: i [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/myldap.c:2403:7: style: Unused variable: rc [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/netgroup.c:101:36: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nslcd/network.c:154:1: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nslcd/nslcd.c:511:1: error: Resource leak: fd [resourceLeak] nss-pam-ldapd-0.9.12/nslcd/nslcd.c:336:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/pam.c:164:7: error: Uninitialized variable: rc [uninitvar] nss-pam-ldapd-0.9.12/nslcd/pam.c:145:44: note: Assuming condition is false nss-pam-ldapd-0.9.12/nslcd/pam.c:164:7: note: Uninitialized variable: rc nss-pam-ldapd-0.9.12/nslcd/pam.c:417:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/pam.c:552:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/pam.c:605:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/pam.c:638:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/pam.c:776:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/passwd.c:576:1: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nslcd/protocol.c:171:1: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nslcd/rpc.c:169:1: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nslcd/service.c:214:1: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nslcd/shadow.c:314:1: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nslcd/usermod.c:158:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nslcd/usermod.c:165:10: style: Variable 'buflen' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nslcd/usermod.c:166:10: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/aliases.c:74:3: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/nss/bsdnss.c:117:6: style: Variable 'af' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/bsdnss.c:137:6: style: Variable 'af' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/ethers.c:38:17: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/ethers.c:37:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/group.c:39:17: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/group.c:38:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/group.c:38:21: style: Unused variable: tmp2int32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/group.c:38:32: style: Unused variable: tmp3int32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/group.c:55:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/group.c:55:21: style: Unused variable: tmp2int32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/group.c:55:32: style: Unused variable: tmp3int32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/hosts.c:74:17: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/hosts.c:70:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/hosts.c:70:32: style: Unused variable: tmp3int32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/hosts.c:117:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/netgroup.c:88:3: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [uselessAssignmentPtrArg] nss-pam-ldapd-0.9.12/nss/netgroup.c:89:3: style: Consecutive return, break, continue, goto or throw statements are unnecessary. [duplicateBreak] nss-pam-ldapd-0.9.12/nss/netgroup.c:41:17: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/netgroup.c:39:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/networks.c:71:17: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/networks.c:68:32: style: Unused variable: tmp3int32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/passwd.c:38:17: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/passwd.c:37:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/protocols.c:38:17: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/protocols.c:37:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/protocols.c:37:21: style: Unused variable: tmp2int32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/protocols.c:37:32: style: Unused variable: tmp3int32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/rpc.c:38:17: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/rpc.c:37:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/rpc.c:37:21: style: Unused variable: tmp2int32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/rpc.c:37:32: style: Unused variable: tmp3int32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/services.c:38:17: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/services.c:37:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/services.c:37:32: style: Unused variable: tmp3int32 [unusedVariable] nss-pam-ldapd-0.9.12/nss/shadow.c:38:17: style: Variable 'bufptr' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/nss/shadow.c:37:11: style: Unused variable: tmpint32 [unusedVariable] nss-pam-ldapd-0.9.12/pam/pam.c:301:3: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/tests/lookup_netgroup.c:51:10: portability: Non reentrant function 'getnetgrent' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getnetgrent_r'. [prohibitedgetnetgrentCalled] nss-pam-ldapd-0.9.12/tests/test_attmap.c:42:3: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/tests/test_cfg.c:42:3: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/tests/test_expr.c:47:3: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/tests/test_getpeercred.c:121:9: style: Variable 'csock' is assigned a value that is never used. [unreadVariable] nss-pam-ldapd-0.9.12/tests/test_myldap.c:411:3: error: There is an unknown macro here somewhere. Configuration is required. If __STRING is a macro then please configure it. [unknownMacro] nss-pam-ldapd-0.9.12/tests/test_set.c:72:25: warning: Assert statement modifies 'v'. [assignmentInAssert] nss-pam-ldapd-0.9.12/tests/test_set.c:74:25: warning: Assert statement modifies 'v'. [assignmentInAssert] nss-pam-ldapd-0.9.12/tests/test_set.c:76:25: warning: Assert statement modifies 'v'. [assignmentInAssert] nss-pam-ldapd-0.9.12/tests/test_tio.c:105:35: warning: Assert statement modifies 'i'. [assignmentInAssert] nss-pam-ldapd-0.9.12/tests/test_tio.c:226:35: warning: Assert statement modifies 'i'. [assignmentInAssert] nss-pam-ldapd-0.9.12/tests/test_tio.c:236:35: warning: Assert statement modifies 'i'. [assignmentInAssert] nss-pam-ldapd-0.9.12/tests/test_tio.c:247:35: warning: Assert statement modifies 'i'. [assignmentInAssert] nss-pam-ldapd-0.9.12/tests/test_tio.c:258:35: warning: Assert statement modifies 'i'. [assignmentInAssert] nss-pam-ldapd-0.9.12/tests/test_tio.c:268:35: warning: Assert statement modifies 'i'. [assignmentInAssert] nss-pam-ldapd-0.9.12/tests/test_tio.c:308:3: error: Resource handle 'wfp' freed twice. [doubleFree] nss-pam-ldapd-0.9.12/tests/test_tio.c:308:3: note: Resource handle 'wfp' freed twice. nss-pam-ldapd-0.9.12/tests/test_tio.c:308:3: note: Resource handle 'wfp' freed twice. nss-pam-ldapd-0.9.12/tests/test_tio_timeout.c:40:19: style: Same expression on both sides of '/'. [duplicateExpression] nss-pam-ldapd-0.9.12/tests/test_tio_timeout.c:32:19: note: 'sleeptime' is assigned value '1000' here. nss-pam-ldapd-0.9.12/tests/test_tio_timeout.c:40:19: note: Same expression on both sides of '/'. diff: head nss-pam-ldapd-0.9.12/compat/pagectrl.c:153:33: style: Parameter 'ld' can be declared as pointer to const [constParameter] 2.8 nss-pam-ldapd-0.9.12/compat/pagectrl.c:153:33: style: Parameter 'ld' can be declared with const [constParameter] head nss-pam-ldapd-0.9.12/nslcd/myldap.c:2504:42: style: Parameter 'session' can be declared as pointer to const [constParameter] 2.8 nss-pam-ldapd-0.9.12/nslcd/myldap.c:2504:42: style: Parameter 'session' can be declared with const [constParameter] DONE