From 0ea5db4f1f55e55942f6afd0e4e69ceb2163ed25 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 30 Jun 1999 17:16:08 +0000 Subject: Update. 1999-06-28 Andreas Jaeger * inet/rcmd.c (__icheckhost): Test for gethostbyname_r result correctly. 1999-06-25 Andreas Jaeger * manual/arith.texi (System V Number Conversion): Fix the description which confused pointer and value to pointer. Reported by Andries.Brouwer@cwi.nl. 1999-06-28 Andreas Jaeger * pwd/getpw.c (__getpw): Check for NULL result pointer. 1999-06-29 Andreas Jaeger * manual/users.texi (Lookup User): Document POSIX return semantics for getpwuid_r and getgrgid_r. * manual/socket.texi (Host Names): Document that the result pointer is null in case of error or host not found and fix a typo. Give a small example. --- pwd/getpw.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pwd') diff --git a/pwd/getpw.c b/pwd/getpw.c index e291769237..5973ef0eea 100644 --- a/pwd/getpw.c +++ b/pwd/getpw.c @@ -50,6 +50,9 @@ __getpw (uid, buf) if (__getpwuid_r (uid, &resbuf, tmpbuf, buflen, &p) != 0) return -1; + if (p == NULL) + return -1; + if (sprintf (buf, "%s:%s:%lu:%lu:%s:%s:%s", p->pw_name, p->pw_passwd, (unsigned long int) p->pw_uid, (unsigned long int) p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell) < 0) -- cgit v1.2.3