summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2004-01-12 13:29:54 +0000
committernectar <nectar@FreeBSD.org>2004-01-12 13:29:54 +0000
commit6722bb8a1037f0957374b25dfff6ab496c86da27 (patch)
tree055bda862247e369718764b9d6fe95915c9c34b6
parentb20733846cacd1472cc0d971f79f0420affa8676 (diff)
downloadFreeBSD-src-6722bb8a1037f0957374b25dfff6ab496c86da27.zip
FreeBSD-src-6722bb8a1037f0957374b25dfff6ab496c86da27.tar.gz
Fix a bug that could result in a null pointer dereference in
getpwent(3) or getpwuid(3) when using NIS adjunct maps. The bug was present in the internal `nis_passwd' function. The lookup in the adjunct map used the name passed into `nis_passwd', however no name was of course supplied by getpwent or getpwuid. Correctly use the name from the `struct pwd' that was found instead. PR: bin/59962 Submitted by: Gabriel Gomez <ggomez@fing.edu.uy>
-rw-r--r--lib/libc/gen/getpwent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 3f73640..c7b3163 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -1125,7 +1125,7 @@ nis_passwd(void *retval, void *mdata, va_list ap)
fin:
if (rv == NS_SUCCESS) {
if (strstr(pwd->pw_passwd, "##") != NULL) {
- rv = nis_adjunct(st->domain, name,
+ rv = nis_adjunct(st->domain, pwd->pw_name,
&buffer[resultlen+1], bufsize-resultlen-1);
if (rv < 0)
goto erange;
OpenPOWER on IntegriCloud