summaryrefslogtreecommitdiff
path: root/libpam_misc/misc_conv.c
diff options
context:
space:
mode:
authorikerexxe <ipedrosa@redhat.com>2020-06-29 11:19:29 +0200
committerDmitry V. Levin <ldv@altlinux.org>2020-07-01 09:54:06 +0000
commit655b5e3cf32cb2bd6606cb8ab696b8f00f87051e (patch)
treed10c82d13f2890fb7c7143b192741966033e6b29 /libpam_misc/misc_conv.c
parent4ed954dcc54183467d23a145cf071c5d6ecdbe92 (diff)
misc_conv: fix potential stack buffer overflow
[ldv: rewrote commit message] * libpam_misc/misc_conv.c (read_string): Use _pam_overwrite_n instead of _pam_overwrite to clear stack buffer "line" because the latter does not have to be null-terminated.
Diffstat (limited to 'libpam_misc/misc_conv.c')
-rw-r--r--libpam_misc/misc_conv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpam_misc/misc_conv.c b/libpam_misc/misc_conv.c
index cabe2dad..70b96454 100644
--- a/libpam_misc/misc_conv.c
+++ b/libpam_misc/misc_conv.c
@@ -244,7 +244,7 @@ static int read_string(int echo, const char *prompt, char **retstr)
D(("the timer appears to have expired"));
*retstr = NULL;
- _pam_overwrite(line);
+ _pam_overwrite_n(line, sizeof(line));
cleanexit: