Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/lib/libtelnet Pull up revision 1.3 (requested by lukem in...



details:   https://anonhg.NetBSD.org/src/rev/cd011993c874
branches:  netbsd-3
changeset: 576528:cd011993c874
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jul 09 22:56:45 2005 +0000

description:
Pull up revision 1.3 (requested by lukem in ticket #536):
check pwd != NULL

diffstat:

 lib/libtelnet/sra.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r 640791848ee2 -r cd011993c874 lib/libtelnet/sra.c
--- a/lib/libtelnet/sra.c       Sat Jul 09 22:56:05 2005 +0000
+++ b/lib/libtelnet/sra.c       Sat Jul 09 22:56:45 2005 +0000
@@ -32,7 +32,7 @@
 #ifdef notdef
 __FBSDID("$FreeBSD: src/contrib/telnet/libtelnet/sra.c,v 1.16 2002/05/06 09:48:02 markm Exp $");
 #else
-__RCSID("$NetBSD: sra.c,v 1.1.2.4 2005/07/09 22:55:46 tron Exp $");
+__RCSID("$NetBSD: sra.c,v 1.1.2.5 2005/07/09 22:56:45 tron Exp $");
 #endif
 
 #ifdef SRA
@@ -426,7 +426,8 @@
        struct passwd pws, *pwd;
        char pwbuf[1024];
 
-       if (getpwnam_r(usr, &pws, pwbuf, sizeof(pwbuf), &pwd) != 0)
+       if (getpwnam_r(usr, &pws, pwbuf, sizeof(pwbuf), &pwd) != 0 ||
+           pwd == NULL)
                return 0;
        return (!pwd->pw_uid);
 }



Home | Main Index | Thread Index | Old Index