summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-04-13 05:08:24 +0000
committerderaadt <deraadt@openbsd.org>1997-04-13 05:08:24 +0000
commite1ef3f59d31ab6b570679ca40ea4cd3c33afa99e (patch)
treeff8880573c0b32db69142d42be7ec60b4c327dcc /lib/libc
parentAdd support for PCI NE2000 clones. I finally got around to doing this :-) (diff)
downloadwireguard-openbsd-e1ef3f59d31ab6b570679ca40ea4cd3c33afa99e.tar.xz
wireguard-openbsd-e1ef3f59d31ab6b570679ca40ea4cd3c33afa99e.zip
buf oflow; bitblt
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/getpwent.c10
-rw-r--r--lib/libc/net/inet_pton.c6
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index db556d05251..7cab9efbccc 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -33,7 +33,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getpwent.c,v 1.8 1996/10/16 09:24:21 downsj Exp $";
+static char rcsid[] = "$OpenBSD: getpwent.c,v 1.9 1997/04/13 05:11:07 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -961,8 +961,12 @@ __hashpw(key)
if ((_pw_db->get)(_pw_db, key, &data, 0))
return(0);
p = (char *)data.data;
- if (data.size > max && !(line = realloc(line, (max += 1024))))
- return(0);
+ if (data.size > max) {
+ max = data.size + 256;
+ line = realloc(line, max);
+ if (line == NULL)
+ return 0;
+ }
t = line;
#define EXPAND(e) e = t; while ((*t++ = *p++));
diff --git a/lib/libc/net/inet_pton.c b/lib/libc/net/inet_pton.c
index 8ffe81ed12f..46b4b24819c 100644
--- a/lib/libc/net/inet_pton.c
+++ b/lib/libc/net/inet_pton.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet_pton.c,v 1.1 1997/03/13 19:07:33 downsj Exp $ */
+/* $OpenBSD: inet_pton.c,v 1.2 1997/04/13 05:08:24 deraadt Exp $ */
/* Copyright (c) 1996 by Internet Software Consortium.
*
@@ -20,7 +20,7 @@
#if 0
static char rcsid[] = "$From: inet_pton.c,v 8.7 1996/08/05 08:31:35 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.1 1997/03/13 19:07:33 downsj Exp $";
+static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.2 1997/04/13 05:08:24 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -100,12 +100,12 @@ inet_pton4(src, dst)
if (new > 255)
return (0);
- *tp = new;
if (! saw_digit) {
if (++octets > 4)
return (0);
saw_digit = 1;
}
+ *tp = new;
} else if (ch == '.' && saw_digit) {
if (octets == 4)
return (0);