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>
This commit is contained in:
nectar 2004-01-12 13:29:54 +00:00
parent b20733846c
commit 6722bb8a10

View File

@ -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;