diff options
author | 2001-04-20 00:10:11 +0000 | |
---|---|---|
committer | 2001-04-20 00:10:11 +0000 | |
commit | 1d800dfffdd6632ca5ec455bf2ef3ca39cc72e30 (patch) | |
tree | 46df03ebcf33e7165b919c833d583eaf656f5131 /lib/libc/stdio/vfprintf.c | |
parent | dmesg printout tweaks (diff) | |
download | wireguard-openbsd-1d800dfffdd6632ca5ec455bf2ef3ca39cc72e30.tar.xz wireguard-openbsd-1d800dfffdd6632ca5ec455bf2ef3ca39cc72e30.zip |
Fix an incorrect memset() in __grow_type_table(); dk@homepage.ru
While I was there I noticed and fixed a bogus realloc().
We should really check malloc/realloc return values and deal sanely
but that will have to be done later. Theo OK'd
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
-rw-r--r-- | lib/libc/stdio/vfprintf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 1aa62dcbf98..fc33fb971f3 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: vfprintf.c,v 1.9 1999/08/22 17:06:35 millert Exp $"; +static char *rcsid = "$OpenBSD: vfprintf.c,v 1.10 2001/04/20 00:10:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -1079,13 +1079,14 @@ __grow_type_table(typetable, tablesize) if (*tablesize == STATIC_ARG_TBL_SIZE) { *typetable = (unsigned char *) malloc (sizeof (unsigned char) * newsize); + /* XXX unchecked */ bcopy (oldtable, *typetable, *tablesize); } else { *typetable = (unsigned char *) - realloc (typetable, sizeof (unsigned char) * newsize); + realloc (*typetable, sizeof (unsigned char) * newsize); /* XXX unchecked */ } - memset (&typetable [*tablesize], T_UNUSED, (newsize - *tablesize)); + memset (*typetable + *tablesize, T_UNUSED, (newsize - *tablesize)); *tablesize = newsize; return(0); |