diff options
author | eivind <eivind@FreeBSD.org> | 1998-12-17 16:31:02 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1998-12-17 16:31:02 +0000 |
commit | aec28cd70ae23f785e90fd95b938d8029d838d5b (patch) | |
tree | f1cb1e7234cc6bca2e752621e0495d485ffa249e | |
parent | f707552d294c0e34af04411cd0f90aba60f7612d (diff) | |
download | FreeBSD-src-aec28cd70ae23f785e90fd95b938d8029d838d5b.zip FreeBSD-src-aec28cd70ae23f785e90fd95b938d8029d838d5b.tar.gz |
Restore old semantics (broken in rev 1.47's buffer overflow fix).
-rw-r--r-- | lib/libc/gen/getpwent.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index e24de81..2ee0e32 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -153,7 +153,9 @@ getpwnam(name) return((struct passwd *)NULL); bf[0] = _PW_KEYBYNAME; - len = MIN(strlen(name), UT_NAMESIZE); + len = strlen(name); + if (len > UT_NAMESIZE) + return(NULL); bcopy(name, bf + 1, len); key.data = (u_char *)bf; key.size = len + 1; |