Task #960 - pam-1.6.1-4.fc41/scan-results.err
back to task #960download
Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/examples/blank.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/examples/blank.c:76:7: warning[deadcode.DeadStores]: Value stored to 'env' is never read # 74| env = pam_getenvlist(pamh); # 75| if (env) # 76|-> env = pam_misc_drop_env(env); # 77| else # 78| fprintf(stderr,"???\n"); Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/examples/check_user.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-823): pam-1.6.1-build/Linux-PAM-1.6.1/examples/tty_conv.c:79: error[arrayIndexOutOfBounds]: Array 'input[512]' accessed at index 512, which is out of bounds. # 77| } # 78| funlockfile(stdin); # 79|-> input[i] = '\0'; # 80| # 81| return (strdup(input)); Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/examples/xsh.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/examples/xsh.c:142:4: warning[deadcode.DeadStores]: Value stored to 'retcode' is never read # 140| # 141| /* this is always a really bad thing for security! */ # 142|-> retcode = system("/bin/sh"); # 143| # 144| /* close a session for the user --- `0' could be PAM_SILENT Error: GCC_ANALYZER_WARNING (CWE-122): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_private.h:303: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/libpam/include/security/_pam_macros.h:48:8: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_env.c:353:17: note: in expansion of macro ‘_pam_drop’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_env.c:352:17: note: in expansion of macro ‘pam_overwrite_string’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_env.c:352:17: note: in expansion of macro ‘pam_overwrite_string’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_env.c:353:17: note: in expansion of macro ‘_pam_drop’ # 46| do { \ # 47| free(X); \ # 48|-> (X)=NULL; \ # 49| } while (0) # 50| Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/include/security/_pam_types.h:33:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:114:12: note: in expansion of macro ‘PAM_SERVICE_ERR’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:114:12: note: in expansion of macro ‘PAM_SERVICE_ERR’ # 31| /* loading a service module */ # 32| #define PAM_SYMBOL_ERR 2 /* Symbol not found */ # 33|-> #define PAM_SERVICE_ERR 3 /* Error in service module */ # 34| #define PAM_SYSTEM_ERR 4 /* System error */ # 35| #define PAM_BUF_ERR 5 /* Memory buffer error */ Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/include/security/_pam_types.h:33:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:114:12: note: in expansion of macro ‘PAM_SERVICE_ERR’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:114:12: note: in expansion of macro ‘PAM_SERVICE_ERR’ # 31| /* loading a service module */ # 32| #define PAM_SYMBOL_ERR 2 /* Symbol not found */ # 33|-> #define PAM_SERVICE_ERR 3 /* Error in service module */ # 34| #define PAM_SYSTEM_ERR 4 /* System error */ # 35| #define PAM_BUF_ERR 5 /* Memory buffer error */ Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/include/security/pam_modules.h:17: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:53: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c: scope_hint: In function ‘call_exec’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/include/security/_pam_types.h:33:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stdout_fds[1]’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:114:12: note: in expansion of macro ‘PAM_SERVICE_ERR’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:57: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:225:11: note: in expansion of macro ‘pam_overwrite_array’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c: scope_hint: In function ‘call_exec’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:114:12: note: in expansion of macro ‘PAM_SERVICE_ERR’ # 31| /* loading a service module */ # 32| #define PAM_SYMBOL_ERR 2 /* Symbol not found */ # 33|-> #define PAM_SERVICE_ERR 3 /* Error in service module */ # 34| #define PAM_SYSTEM_ERR 4 /* System error */ # 35| #define PAM_BUF_ERR 5 /* Memory buffer error */ Error: GCC_ANALYZER_WARNING (CWE-401): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/include/security/_pam_types.h:33:25: warning[-Wanalyzer-malloc-leak]: leak of ‘stdout_file’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:114:12: note: in expansion of macro ‘PAM_SERVICE_ERR’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:114:12: note: in expansion of macro ‘PAM_SERVICE_ERR’ # 31| /* loading a service module */ # 32| #define PAM_SYMBOL_ERR 2 /* Symbol not found */ # 33|-> #define PAM_SERVICE_ERR 3 /* Error in service module */ # 34| #define PAM_SYSTEM_ERR 4 /* System error */ # 35| #define PAM_BUF_ERR 5 /* Memory buffer error */ Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_audit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_data.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_dispatch.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_dispatch.c:204:17: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 202| case _PAM_ACTION_RESET: # 203| # 204|-> impression = substates[stack_level].impression; # 205| status = substates[stack_level].status; # 206| break; Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_end.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_env.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-122): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_env.c: scope_hint: In function ‘_copy_env’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_env.c:351:24: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_env.c:14: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_env.c:352:17: note: in expansion of macro ‘pam_overwrite_string’ # └──────────────────────────────────┘ # ^ # 349| /* out of memory */ # 350| # 351|-> while (dump[++i]) { # 352| pam_overwrite_string(dump[i]); # 353| _pam_drop(dump[i]); Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_get_authtok.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_handlers.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_handlers.c:90:21: warning[deadcode.DeadStores]: Although the value stored to 'tok' is used in the enclosing expression, the value is never actually read from 'tok' # 88| this_service = known_service; # 89| } else { # 90|-> this_service = tok = _pam_tokenize(buf, &nexttok); # 91| } # 92| Error: GCC_ANALYZER_WARNING (CWE-131): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_handlers.c: scope_hint: In function ‘_pam_add_handler’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_handlers.c:853:38: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_handlers.c:9: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_handlers.c:716:5: note: in expansion of macro ‘IF_NO_PAMH’ # 851| (*handler_p2)->argc = argc; # 852| if (argv) { # 853|-> if (((*handler_p2)->argv = malloc(argvlen)) == NULL) { # 854| pam_syslog(pamh, LOG_CRIT, "cannot malloc argv for handler #2"); # 855| return (PAM_ABORT); Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_item.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_misc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_misc.c:140:14: warning[deadcode.DeadStores]: Value stored to 'len' is never read # 138| if (x != NULL) { # 139| if ((new = malloc(len)) == NULL) { # 140|-> len = 0; # 141| pam_syslog(NULL, LOG_CRIT, "_pam_memdup: failed to get memory"); # 142| } else { Error: GCC_ANALYZER_WARNING (CWE-131): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_misc.c: scope_hint: In function ‘_pam_mkargv’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_misc.c:169:35: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size # 167| /* Overkill on the malloc, but not large */ # 168| argvlen = (l + 1) * (sizeof(char) + sizeof(char *)); # 169|-> if ((our_argv = argvbuf = malloc(argvlen)) == NULL) { # 170| pam_syslog(NULL, LOG_CRIT, "pam_mkargv: null returned by malloc"); # 171| argvlen = 0; Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_check_user.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getgrgid.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getgrgid.c: scope_hint: In function ‘pam_modutil_getgrgid’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getgrgid.c:83:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data_name’ where non-null expected pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getgrgid.c:12: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getgrgid.c: scope_hint: In function ‘pam_modutil_getgrgid’ <built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null # 81| if (pamh != NULL) { # 82| for (i = 0; i < INT_MAX; i++) { # 83|-> sprintf(data_name, "_pammodutil_getgrgid_%ld_%d", # 84| (long) gid, i); # 85| status = PAM_NO_MODULE_DATA; Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getgrnam.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getgrnam.c: scope_hint: In function ‘pam_modutil_getgrnam’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getgrnam.c:73:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data_name’ where non-null expected pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getgrnam.c:12: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getgrnam.c: scope_hint: In function ‘pam_modutil_getgrnam’ <built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null # 71| if (pamh != NULL) { # 72| for (i = 0; i < INT_MAX; i++) { # 73|-> sprintf(data_name, "_pammodutil_getgrnam_%s_%d", group, i); # 74| status = PAM_NO_MODULE_DATA; # 75| if (pam_get_data(pamh, data_name, &ignore) != PAM_SUCCESS) { Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getpwnam.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getpwnam.c: scope_hint: In function ‘pam_modutil_getpwnam’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getpwnam.c:73:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data_name’ where non-null expected pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getpwnam.c:12: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getpwnam.c: scope_hint: In function ‘pam_modutil_getpwnam’ <built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null # 71| if (pamh != NULL) { # 72| for (i = 0; i < INT_MAX; i++) { # 73|-> sprintf(data_name, "_pammodutil_getpwnam_%s_%d", user, i); # 74| status = PAM_NO_MODULE_DATA; # 75| if (pam_get_data(pamh, data_name, &ignore) != PAM_SUCCESS) { Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getpwuid.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getpwuid.c: scope_hint: In function ‘pam_modutil_getpwuid’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getpwuid.c:83:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data_name’ where non-null expected pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getpwuid.c:12: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getpwuid.c: scope_hint: In function ‘pam_modutil_getpwuid’ <built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null # 81| if (pamh != NULL) { # 82| for (i = 0; i < INT_MAX; i++) { # 83|-> sprintf(data_name, "_pammodutil_getpwuid_%ld_%d", # 84| (long) uid, i); # 85| status = PAM_NO_MODULE_DATA; Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getspnam.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getspnam.c: scope_hint: In function ‘pam_modutil_getspnam’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getspnam.c:73:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data_name’ where non-null expected pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getspnam.c:12: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_getspnam.c: scope_hint: In function ‘pam_modutil_getspnam’ <built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null # 71| if (pamh != NULL) { # 72| for (i = 0; i < INT_MAX; i++) { # 73|-> sprintf(data_name, "_pammodutil_getspnam_%s_%d", user, i); # 74| status = PAM_NO_MODULE_DATA; # 75| if (pam_get_data(pamh, data_name, &ignore) != PAM_SUCCESS) { Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_ingroup.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_priv.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_sanitize.c: scope_hint: In function ‘redirect_in_pipe’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_sanitize.c:29:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in[0]’ # 27| if (pipe(in) < 0) { # 28| pam_syslog(pamh, LOG_ERR, "Could not create pipe: %m"); # 29|-> return -1; # 30| } # 31| Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_sanitize.c:37:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(in[0], fd)’ # 35| return fd; # 36| # 37|-> if (dup2(in[0], fd) != fd) { # 38| pam_syslog(pamh, LOG_ERR, "dup2 of %s failed: %m", name); # 39| fd = -1; Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_sanitize.c: scope_hint: In function ‘redirect_out_null’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_sanitize.c:60:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’ # 58| } # 59| # 60|-> if (null == fd) # 61| return fd; # 62| Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_sanitize.c:63:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 1), fd)’ # 61| return fd; # 62| # 63|-> if (dup2(null, fd) != fd) { # 64| pam_syslog(pamh, LOG_ERR, "dup2 of %s failed: %m", name); # 65| fd = -1; Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_sanitize.c: scope_hint: In function ‘pam_modutil_sanitize_helper_fds’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_sanitize.c:150:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(1, 2)’ # 148| if (stderr_mode != PAM_MODUTIL_IGNORE_FD && # 149| stdout_mode == stderr_mode) { # 150|-> if (dup2(STDOUT_FILENO, STDERR_FILENO) != STDERR_FILENO) { # 151| pam_syslog(pamh, LOG_ERR, # 152| "dup2 of %s failed: %m", "stderr"); Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_searchkey.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-477): pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_searchkey.c: scope_hint: In function ‘econf_search_key’ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_searchkey.c:33:9: warning[-Wdeprecated-declarations]: ‘econf_readDirs’ is deprecated: Use the econf_readConfig/econf_readConfigWithCallback instead # 33 | if (econf_readDirs (&key_file, VENDORDIR, SYSCONFDIR, name, suffix, # | ^~ pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_modutil_searchkey.c:17: included_from: Included from here. /usr/include/libeconf.h:483:1: note: declared here # 483 | econf_readDirs(econf_file **key_file, # | ^~~~~~~~~~~~~~ # 31| char *val; # 32| # 33|-> if (econf_readDirs (&key_file, VENDORDIR, SYSCONFDIR, name, suffix, # 34| " \t", "#")) # 35| return NULL; Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_password.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_start.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam/pam_vprompt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam_internal/pam_line.c:45:5: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 43| } # 44| # 45|-> memcpy(buffer->assembled + buffer->len, start, len); # 46| buffer->len += len; # 47| buffer->assembled[buffer->len] = '\0'; Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpam_misc/misc_conv.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpamc/pamc_client.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpamc/pamc_client.c:147:2: warning[deadcode.DeadStores]: Value stored to 'pid' is never read # 145| retval = PAM_BPC_FALSE; # 146| } # 147|-> pid = this->pid = 0; # 148| # 149| pam_overwrite_n(this->id, this->id_length); Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/libpamc/pamc_load.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_access/pam_access.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_chroot/pam_chroot.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_chroot/pam_chroot.c: scope_hint: In function ‘pam_sm_open_session’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_chroot/pam_chroot.c:86:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘errbuf’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null # 84| len = regerror(err, &name_regex, NULL, 0); # 85| errbuf = malloc(len + 1); # 86|-> memset(errbuf, 0, len + 1); # 87| regerror(err, &name_regex, errbuf, len); # 88| Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_echo/pam_echo.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_env/pam_env.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-477): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_env/pam_env.c: scope_hint: In function ‘econf_read_file’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_env/pam_env.c:245:7: warning[-Wdeprecated-declarations]: ‘econf_readDirs’ is deprecated: Use the econf_readConfig/econf_readConfigWithCallback instead pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_env/pam_env.c:24: included_from: Included from here. /usr/include/libeconf.h:483:1: note: declared here # 243| # 244| D(("Read configuration from directory %s and %s", vendor_dir, sysconf_dir)); # 245|-> error = econf_readDirs (&key_file, vendor_dir, sysconf_dir, name, suffix, # 246| delim, "#"); # 247| free(vendor_dir); Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_env/pam_env.c:276:14: warning[unix.MallocSizeof]: Result of 'calloc' is converted to a pointer of type 'char *', which is incompatible with sizeof operand type 'char **' # 274| } # 275| # 276|-> *lines = calloc((key_number + 1), sizeof(char**)); # 277| if (*lines == NULL) { # 278| pam_syslog(pamh, LOG_ERR, "Cannot allocate memory."); Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_env/pam_env.c:451:11: warning[unix.Malloc]: Potential memory leak # 449| *valptr = "e; /* a quick hack to handle the empty string */ # 450| } # 451|-> ptr = tmpptr; /* Start the search where we stopped */ # 452| } /* while */ # 453| Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:345:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’ # 343| if (expose_authtok) # 344| { # 345|-> fds[0] = move_fd_to_non_stdio(pamh, fds[0]); # 346| close(fds[1]); # 347| } Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:351:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stdout_fds[1]’ # 349| if (use_stdout) # 350| { # 351|-> stdout_fds[1] = move_fd_to_non_stdio(pamh, stdout_fds[1]); # 352| close(stdout_fds[0]); # 353| } Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:360:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fds[0], 0)’ # 358| { # 359| /* reopen stdin as pipe */ # 360|-> if (dup2(fds[0], STDIN_FILENO) == -1) # 361| { # 362| int err = errno; Error: GCC_ANALYZER_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:395:19: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’ # 393| if (i != STDOUT_FILENO) # 394| { # 395|-> if (dup2 (i, STDOUT_FILENO) == -1) # 396| { # 397| int err = errno; Error: GCC_ANALYZER_WARNING (CWE-910): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:411:11: warning[-Wanalyzer-fd-use-after-close]: ‘dup2’ on closed file descriptor ‘1’ # 409| # 410| if ((use_stdout || logfile) && # 411|-> dup2 (STDOUT_FILENO, STDERR_FILENO) == -1) # 412| { # 413| int err = errno; Error: GCC_ANALYZER_WARNING (CWE-688): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:488:7: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_exec/pam_exec.c:46: included_from: Included from here. /usr/include/unistd.h:572:12: note: argument 1 of ‘execve’ must be non-null # 486| # 487| DIAG_PUSH_IGNORE_CAST_QUAL; # 488|-> execve (arggv[0], (char **) arggv, envlist); # 489| DIAG_POP_IGNORE_CAST_QUAL; # 490| i = errno; Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_faillock/faillock.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_faillock/faillock_config.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_faillock/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-252): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_faillock/main.c: scope_hint: In function ‘do_user’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_faillock/main.c:250:25: warning[-Wunused-result]: ignoring return value of ‘audit_log_acct_message’ declared with attribute ‘warn_unused_result’ # 250 | audit_log_acct_message(audit_fd, AUDIT_USER_MGMT, NULL, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 251 | "faillock-reset", user, # | ~~~~~~~~~~~~~~~~~~~~~~~ # 252 | pwd != NULL ? pwd->pw_uid : AUDIT_NO_ID, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 253 | NULL, NULL, NULL, rv == 0); # | ~~~~~~~~~~~~~~~~~~~~~~~~~~ # 248| } # 249| if ((audit_fd=audit_open()) >= 0) { # 250|-> audit_log_acct_message(audit_fd, AUDIT_USER_MGMT, NULL, # 251| "faillock-reset", user, # 252| pwd != NULL ? pwd->pw_uid : AUDIT_NO_ID, Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_faillock/pam_faillock.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-252): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_faillock/pam_faillock.c: scope_hint: In function ‘check_tally’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_faillock/pam_faillock.c:256:33: warning[-Wunused-result]: ignoring return value of ‘audit_log_user_message’ declared with attribute ‘warn_unused_result’ # 256 | audit_log_user_message(audit_fd, AUDIT_RESP_ACCT_UNLOCK_TIMED, buf, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 257 | rhost, NULL, tty, 1); # | ~~~~~~~~~~~~~~~~~~~~ # 254| (void)pam_get_item(pamh, PAM_RHOST, &rhost); # 255| snprintf(buf, sizeof(buf), "op=pam_faillock suid=%u ", opts->uid); # 256|-> audit_log_user_message(audit_fd, AUDIT_RESP_ACCT_UNLOCK_TIMED, buf, # 257| rhost, NULL, tty, 1); # 258| audit_close(audit_fd); Error: COMPILER_WARNING (CWE-252): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_faillock/pam_faillock.c: scope_hint: In function ‘write_tally’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_faillock/pam_faillock.c:373:17: warning[-Wunused-result]: ignoring return value of ‘audit_log_user_message’ declared with attribute ‘warn_unused_result’ # 373 | audit_log_user_message(audit_fd, AUDIT_ANOM_LOGIN_FAILURES, buf, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 374 | NULL, NULL, NULL, 1); # | ~~~~~~~~~~~~~~~~~~~~ # 371| # 372| snprintf(buf, sizeof(buf), "op=pam_faillock suid=%u ", opts->uid); # 373|-> audit_log_user_message(audit_fd, AUDIT_ANOM_LOGIN_FAILURES, buf, # 374| NULL, NULL, NULL, 1); # 375| Error: COMPILER_WARNING (CWE-252): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_faillock/pam_faillock.c:377:25: warning[-Wunused-result]: ignoring return value of ‘audit_log_user_message’ declared with attribute ‘warn_unused_result’ # 377 | audit_log_user_message(audit_fd, AUDIT_RESP_ACCT_LOCK, buf, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 378 | NULL, NULL, NULL, 1); # | ~~~~~~~~~~~~~~~~~~~~ # 375| # 376| if (!opts->is_admin || (opts->flags & FAILLOCK_FLAG_DENY_ROOT)) { # 377|-> audit_log_user_message(audit_fd, AUDIT_RESP_ACCT_LOCK, buf, # 378| NULL, NULL, NULL, 1); # 379| } Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_filter/pam_filter.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_filter/pam_filter.c:53:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/ptmx", 2)’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_filter/pam_filter.c: scope_hint: In function ‘set_filter’ # 51| int fd; # 52| # 53|-> if ((fd = open(DEV_PTMX, O_RDWR)) >= 0) { # 54| return fd; # 55| } Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_filter/upperLOWER/upperLOWER.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_ftp/pam_ftp.c:176:7: warning[deadcode.DeadStores]: Value stored to 'retval' is never read # 174| if ((token) && (retval == PAM_SUCCESS)) { # 175| token = strtok_r(NULL, "@", &sptr); # 176|-> retval = pam_set_item(pamh, PAM_RHOST, token); # 177| } # 178| } Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_group/pam_group.c: scope_hint: In function ‘read_field’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_group/pam_group.c:133:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_group/pam_group.c:603:24: note: in expansion of macro ‘blk_size’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_group/pam_group.c:44: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_group/pam_group.c:132:9: note: in expansion of macro ‘_pam_drop’ # 131| /* nothing previously in buf, nothing read */ # 132| _pam_drop(*buf); # 133|-> *state = STATE_EOF; # 134| return -1; # 135| } Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_group/pam_group.c:434:4: warning[deadcode.DeadStores]: Value stored to 'j' is never read # 432| time_end += times[i+j]-'0'; /* is this portable? */ # 433| } # 434|-> j += i; # 435| } else # 436| time_end = -1; Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_group/pam_group.c:749:2: warning[deadcode.DeadStores]: Value stored to 'no_grps' is never read # 747| pam_overwrite_n(grps, sizeof(gid_t) * blk_size(no_grps)); # 748| _pam_drop(grps); # 749|-> no_grps = 0; # 750| } # 751| Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_issue/pam_issue.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-457): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_issue/pam_issue.c: scope_hint: In function ‘read_issue_quoted’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_issue/pam_issue.c:216:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘src’ # 214| issue = new_issue; # 215| } # 216|-> memcpy(issue + issue_len, src, len); # 217| issue_len += len; # 218| } Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_issue/pam_issue.c:300:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'issue_prompt' # 298| } # 299| # 300|-> retval = pam_set_item(pamh, PAM_USER_PROMPT, # 301| (const void *) issue_prompt); # 302| out: Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_keyinit/pam_keyinit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_lastlog/pam_lastlog.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_lastlog/pam_lastlog.c:804:5: warning[deadcode.DeadStores]: Value stored to 'uid' is never read # 802| /* indicate success or failure */ # 803| # 804|-> uid = -1; /* forget this */ # 805| # 806| return retval; Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_limits/pam_limits.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_listfile/pam_listfile.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_listfile/pam_listfile.c:130:6: warning[deadcode.DeadStores]: Value stored to 'apply_type' is never read # 128| } # 129| } else if ((str = pam_str_skip_prefix(argv[i], "apply=")) != NULL) { # 130|-> apply_type=APPLY_TYPE_NONE; # 131| if (*str=='@') { # 132| apply_type=APPLY_TYPE_GROUP; Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_localuser/pam_localuser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_loginuid/pam_loginuid.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_mail/pam_mail.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_mail/pam_mail.c:226:16: warning[core.NullDereference]: Array access (from variable 'namelist') results in a null pointer dereference # 224| type = (i > 2) ? HAVE_NEW_MAIL : 0; # 225| while (--i >= 0) # 226|-> _pam_drop(namelist[i]); # 227| _pam_drop(namelist); # 228| if (type == 0) { Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_mail/pam_mail.c:250:13: warning[core.NullDereference]: Array access (from variable 'namelist') results in a null pointer dereference # 248| type = (ctrl & PAM_EMPTY_TOO) ? HAVE_NO_MAIL : 0; # 249| while (--i >= 0) # 250|-> _pam_drop(namelist[i]); # 251| _pam_drop(namelist); # 252| } Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_mail/pam_mail.c:451:6: warning[deadcode.DeadStores]: Value stored to 'type' is never read # 449| if (type != 0) { # 450| retval = report_mail(pamh, ctrl, type, folder); # 451|-> type = 0; # 452| } # 453| } Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_mkhomedir/mkhomedir_helper.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_mkhomedir/pam_mkhomedir.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_motd/pam_motd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_motd/pam_motd.c:280:15: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull' # 278| # 279| /* Skip duplicate file names. */ # 280|-> if (i > 0 && strcmp(dirnames_all[i], dirnames_all[i - 1]) == 0) { # 281| continue; # 282| } Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_motd/pam_motd.c:357:22: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 355| # 356| for (i = 0; i < num_motd_paths; i++) { # 357|-> int fd = open(motd_path_split[i], O_RDONLY, 0); # 358| # 359| if (fd >= 0) { Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_namespace/argv_parse.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_namespace/pam_namespace.c:667:20: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 665| struct passwd *pwd; # 666| # 667|-> tptr = strchr(ustr, ','); # 668| if (tptr) # 669| *tptr = '\0'; Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_namespace/pam_namespace.c:1141:2: warning[unix.Malloc]: Potential memory leak # 1139| freecon(*i_context); # 1140| *i_context = NULL; # 1141|-> freecon(*origcon); # 1142| *origcon = NULL; # 1143| #endif Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_nologin/pam_nologin.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_pwhistory/opasswd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_pwhistory/opasswd.c:204: warning[uninitvar]: Uninitialized variable: entry.old_passwords # 202| fclose (oldpf); # 203| # 204|-> if (found && entry.old_passwords) # 205| { # 206| const char delimiters[] = ","; Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_pwhistory/pam_pwhistory.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_pwhistory/pam_pwhistory.c: scope_hint: In function ‘run_check_helper’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_pwhistory/pam_pwhistory.c:214:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fds[0], 0)’ # 212| # 213| /* reopen stdin as pipe */ # 214|-> if (dup2(fds[0], STDIN_FILENO) != STDIN_FILENO) # 215| { # 216| pam_syslog(pamh, LOG_ERR, "dup2 of %s failed: %m", "stdin"); Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_pwhistory/pwhistory_config.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_pwhistory/pwhistory_helper.c:71: error[uninitvar]: Uninitialized variable: pass # 69| } # 70| # 71|-> retval = check_old_pass(user, pass, filename, dbg); # 72| # 73| pam_overwrite_array(pass); /* clear memory of the password */ Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_rhosts/pam_rhosts.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_securetty/pam_securetty.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_selinux/pam_selinux.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_sepermit/pam_sepermit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_setquota/pam_setquota.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_shells/pam_shells.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_stress/pam_stress.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_succeed_if/pam_succeed_if.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_succeed_if/pam_succeed_if.c:317:20: warning[core.NullDereference]: Access to field 'pw_uid' results in a dereference of a null pointer # 315| } else if (strcasecmp(left, "uid") == 0) { # 316| snprintf(numstr, sizeof(numstr), "%lu", # 317|-> (unsigned long) (*pwd)->pw_uid); # 318| left = numstr; # 319| } else if (strcasecmp(left, "gid") == 0) { Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_succeed_if/pam_succeed_if.c:321:20: warning[core.NullDereference]: Access to field 'pw_gid' results in a dereference of a null pointer # 319| } else if (strcasecmp(left, "gid") == 0) { # 320| snprintf(numstr, sizeof(numstr), "%lu", # 321|-> (unsigned long) (*pwd)->pw_gid); # 322| left = numstr; # 323| } else if (strcasecmp(left, "shell") == 0) { Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_succeed_if/pam_succeed_if.c:324:10: warning[core.NullDereference]: Access to field 'pw_shell' results in a dereference of a null pointer # 322| left = numstr; # 323| } else if (strcasecmp(left, "shell") == 0) { # 324|-> left = (*pwd)->pw_shell; # 325| } else if ((strcasecmp(left, "home") == 0) || # 326| (strcasecmp(left, "dir") == 0) || Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_succeed_if/pam_succeed_if.c:328:10: warning[core.NullDereference]: Access to field 'pw_dir' results in a dereference of a null pointer # 326| (strcasecmp(left, "dir") == 0) || # 327| (strcasecmp(left, "homedir") == 0)) { # 328|-> left = (*pwd)->pw_dir; # 329| } else if (strcasecmp(left, "service") == 0) { # 330| const void *svc; Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_time/pam_time.c: scope_hint: In function ‘read_field’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_time/pam_time.c:186:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_time/pam_time.c:26: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_time/pam_time.c:185:9: note: in expansion of macro ‘_pam_drop’ # 184| /* nothing previously in buf, nothing read */ # 185| _pam_drop(*buf); # 186|-> *state = STATE_EOF; # 187| return -1; # 188| } Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_time/pam_time.c:270:8: warning[core.NullDereference]: Array access (from variable 'string') results in a null pointer dereference # 268| to=*at; # 269| do { # 270|-> c = string[to++]; # 271| # 272| switch (c) { Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_time/pam_time.c:317:12: warning[core.NullDereference]: Array access (from variable 'x') results in a null pointer dereference # 315| # 316| while ((l = logic_member(x,&at))) { # 317|-> int c = x[at]; # 318| # 319| if (next == VAL) { Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_time/pam_time.c:489:4: warning[deadcode.DeadStores]: Value stored to 'j' is never read # 487| time_end += times[i+j]-'0'; /* is this portable */ # 488| } # 489|-> j += i; # 490| } else # 491| time_end = -1; Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_timestamp/hmac_openssl_wrapper.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_timestamp/pam_timestamp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_timestamp/pam_timestamp_check.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_tty_audit/pam_tty_audit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_tty_audit/pam_tty_audit.c:153:18: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value # 151| return -1; # 152| } # 153|-> if (err.error == 0) # 154| goto again; # 155| errno = -err.error; Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_tty_audit/pam_tty_audit.c:379:27: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value # 377| new_status.log_passwd = log_passwd; # 378| #endif /* HAVE_STRUCT_AUDIT_TTY_STATUS_LOG_PASSWD */ # 379|-> if (old_status->enabled == new_status.enabled # 380| #ifdef HAVE_STRUCT_AUDIT_TTY_STATUS_LOG_PASSWD # 381| && old_status->log_passwd == new_status.log_passwd Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_umask/pam_umask.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/bigcrypt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/md5_broken.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/md5_good.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/pam_unix_acct.c: scope_hint: In function ‘_unix_run_verify_binary’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/pam_unix_acct.c:102:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fds[1], 1)’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/pam_unix_acct.c:61: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/support.h:40:23: note: in expansion of macro ‘on’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/pam_unix_acct.c:79:7: note: in expansion of macro ‘off’ # 100| # 101| /* reopen stdout as pipe */ # 102|-> if (dup2(fds[1], STDOUT_FILENO) != STDOUT_FILENO) { # 103| pam_syslog(pamh, LOG_ERR, "dup2 of %s failed: %m", "stdout"); # 104| _exit(PAM_AUTHINFO_UNAVAIL); Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/pam_unix_auth.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/pam_unix_passwd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/pam_unix_passwd.c: scope_hint: In function ‘_unix_run_update_binary’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/pam_unix_passwd.c:261:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fds[0], 0)’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/pam_unix_passwd.c:72: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/support.h:40:23: note: in expansion of macro ‘on’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/pam_unix_passwd.c:237:9: note: in expansion of macro ‘off’ # 259| # 260| /* reopen stdin as pipe */ # 261|-> if (dup2(fds[0], STDIN_FILENO) != STDIN_FILENO) { # 262| pam_syslog(pamh, LOG_ERR, "dup2 of %s failed: %m", "stdin"); # 263| _exit(PAM_AUTHINFO_UNAVAIL); Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/pam_unix_sess.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/passverify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/passverify.c:424: error[uninitvar]: Uninitialized variable: src # 422| i = clock(); # 423| GoodMD5Update(&ctx, (void *) &i, sizeof i); # 424|-> GoodMD5Update(&ctx, src, length); # 425| GoodMD5Final(tmp, &ctx); # 426| #ifdef PAM_PATH_RANDOMDEV Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/passverify.c:499:2: warning[deadcode.DeadStores]: Value stored to 'sp' is never read # 497| * guaranteed to have crypt_gensalt_rn(). # 498| */ # 499|-> sp = crypt_gensalt_rn(algoid, rounds, NULL, 0, salt, sizeof(salt)); # 500| #else # 501| sp = stpcpy(salt, algoid); Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/passverify.c:1111:2: warning[deadcode.DeadStores]: Value stored to 'retval' is never read # 1109| int retval; # 1110| # 1111|-> retval = get_pwd_hash(name, &pwd, &hash); # 1112| # 1113| if (pwd == NULL || hash == NULL) { Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/support.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-823): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/support.c:172: error[arrayIndexOutOfBounds]: Array 'unix_args[34]' accessed at index 34, which is out of bounds. # 170| } # 171| # 172|-> ctrl &= unix_args[j].mask; /* for turning things off */ # 173| ctrl |= unix_args[j].flag; /* for turning things on */ # 174| } Error: CPPCHECK_WARNING (CWE-823): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/support.c:173: error[arrayIndexOutOfBounds]: Array 'unix_args[34]' accessed at index 34, which is out of bounds. # 171| # 172| ctrl &= unix_args[j].mask; /* for turning things off */ # 173|-> ctrl |= unix_args[j].flag; /* for turning things on */ # 174| } # 175| } Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/support.c:455:10: warning[unix.MallocSizeof]: Result of 'calloc' is converted to a pointer of type 'struct passwd', which is incompatible with sizeof operand type 'char' # 453| strlen(shome) + 1 + # 454| strlen(sshell) + 1; # 455|-> *ret = calloc(retlen, sizeof(char)); # 456| if (*ret == NULL) { # 457| goto fail; Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/support.c: scope_hint: In function ‘_unix_run_helper_binary’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/support.c:555:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fds[0], 0)’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/support.c:33: included_from: Included from here. pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/support.h:40:23: note: in expansion of macro ‘on’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/support.c:532:9: note: in expansion of macro ‘off’ # 553| # 554| /* reopen stdin as pipe */ # 555|-> if (dup2(fds[0], STDIN_FILENO) != STDIN_FILENO) { # 556| pam_syslog(pamh, LOG_ERR, "dup2 of %s failed: %m", "stdin"); # 557| _exit(PAM_AUTHINFO_UNAVAIL); Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/unix_chkpwd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_unix/yppasswd_xdr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_userdb/pam_userdb.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_usertype/pam_usertype.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_wheel/pam_wheel.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_wheel/pam_wheel.c:139:17: warning[deadcode.DeadStores]: Value stored to 'retval' is never read # 137| retval = pam_get_item(pamh, PAM_RHOST, (const void **)&rhostname); # 138| if (retval != PAM_SUCCESS || rhostname == NULL) { # 139|-> retval = pam_get_item(pamh, PAM_RUSER, (const void **)&fromsu); # 140| } # 141| } Error: CPPCHECK_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_xauth/pam_xauth.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_xauth/pam_xauth.c: scope_hint: In function ‘run_coprocess’ pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_xauth/pam_xauth.c:160:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(ipipe[0], 0)’ # 158| * everything else, including the original values for the # 159| * descriptors. */ # 160|-> if (dup2(ipipe[0], STDIN_FILENO) != STDIN_FILENO) { # 161| int err = errno; # 162| pam_syslog(pamh, LOG_ERR, "dup2 of %s failed: %m", "stdin"); Error: GCC_ANALYZER_WARNING (CWE-775): pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_xauth/pam_xauth.c:165:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(opipe[1], 1)’ # 163| _exit(err); # 164| } # 165|-> if (dup2(opipe[1], STDOUT_FILENO) != STDOUT_FILENO) { # 166| int err = errno; # 167| pam_syslog(pamh, LOG_ERR, "dup2 of %s failed: %m", "stdout"); Error: CLANG_WARNING: pam-1.6.1-build/Linux-PAM-1.6.1/modules/pam_xauth/pam_xauth.c:506:16: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 504| /* Figure out where the source user's .Xauthority file is. */ # 505| if (getenv(XAUTHENV) != NULL) { # 506|-> cookiefile = strdup(getenv(XAUTHENV)); # 507| if (cookiefile == NULL) { # 508| retval = PAM_SESSION_ERR;