diff options
author | Dmitry V. Levin <ldv@strace.io> | 2024-05-19 15:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2024-05-19 15:00:00 +0000 |
commit | aabd5314a6d76968c377969b49118a2df3f97003 (patch) | |
tree | fd1832c9174626a97454ee6f070b4d6c15560a45 /modules | |
parent | 0f6796ec4c9429494653be48a3cf13b45e55c86f (diff) | |
download | pam-aabd5314a6d76968c377969b49118a2df3f97003.tar.gz pam-aabd5314a6d76968c377969b49118a2df3f97003.tar.bz2 pam-aabd5314a6d76968c377969b49118a2df3f97003.zip |
pam_env: fix NULL dereference on error path in econf_read_file
* modules/pam_env/pam_env.c [USE_ECONF] (econf_read_file): Handle NULL
value returned by econf_getStringValue().
Resolves: https://github.com/linux-pam/linux-pam/issues/796
Diffstat (limited to 'modules')
-rw-r--r-- | modules/pam_env/pam_env.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/pam_env/pam_env.c b/modules/pam_env/pam_env.c index 2cc58228..6d39bb24 100644 --- a/modules/pam_env/pam_env.c +++ b/modules/pam_env/pam_env.c @@ -287,7 +287,7 @@ econf_read_file(const pam_handle_t *pamh, const char *filename, const char *deli char *val; error = econf_getStringValue (key_file, NULL, keys[i], &val); - if (error != ECONF_SUCCESS) { + if (error != ECONF_SUCCESS || val == NULL) { pam_syslog(pamh, LOG_ERR, "Unable to get string from key %s: %s", keys[i], econf_errString(error)); |