aboutsummaryrefslogtreecommitdiff
path: root/libpam
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2023-11-13 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2023-11-14 23:25:00 +0000
commit6a4bf999a7bd5da780fa4157d4397548ffe0c30f (patch)
tree715022f8e502df28d8ccba12a8687ac41c2775bd /libpam
parentd89e94b061f388bedd4a0bb69b3fb1ba195e11fa (diff)
downloadpam-6a4bf999a7bd5da780fa4157d4397548ffe0c30f.tar.gz
pam-6a4bf999a7bd5da780fa4157d4397548ffe0c30f.tar.bz2
pam-6a4bf999a7bd5da780fa4157d4397548ffe0c30f.zip
libpam: fix _pam_mkargv return value on error path
* libpam/pam_misc.c (_pam_mkargv): Return 0 in case of memory allocation failure.
Diffstat (limited to 'libpam')
-rw-r--r--libpam/pam_misc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libpam/pam_misc.c b/libpam/pam_misc.c
index 22b613e1..9588be17 100644
--- a/libpam/pam_misc.c
+++ b/libpam/pam_misc.c
@@ -192,6 +192,7 @@ int _pam_mkargv(const char *s, char ***argv, int *argc)
if ((our_argv = argvbuf = malloc(argvlen)) == NULL) {
pam_syslog(NULL, LOG_CRIT,
"pam_mkargv: null returned by malloc");
+ argvlen = 0;
} else {
char *tmp=NULL;