diff options
author | Doug Hogan <doug@cvs.openbsd.org> | 2014-10-08 04:08:48 +0000 |
---|---|---|
committer | Doug Hogan <doug@cvs.openbsd.org> | 2014-10-08 04:08:48 +0000 |
commit | 943bd3702ccb622601eb6c5fdd3439b2fba96595 (patch) | |
tree | 6e18b63f26f7f60b09699bdd59194c378917aa07 /usr.bin/rs | |
parent | 60e299c97f380e465fdfb1e15b15c5c20ff6d47e (diff) |
userland reallocarray audit.
Replace malloc() and realloc() calls that may have integer overflow in the
multiplication of the size argument with reallocarray().
ok deraadt@
Diffstat (limited to 'usr.bin/rs')
-rw-r--r-- | usr.bin/rs/rs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c index 3c6ed1a4a72..f29f580f0d8 100644 --- a/usr.bin/rs/rs.c +++ b/usr.bin/rs/rs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rs.c,v 1.23 2013/11/15 15:47:53 millert Exp $ */ +/* $OpenBSD: rs.c,v 1.24 2014/10/08 04:07:24 doug Exp $ */ /*- * Copyright (c) 1993 @@ -340,7 +340,7 @@ getptrs(char **sp) int newsize; newsize = allocsize * 2; - p = realloc(elem, newsize * sizeof(char *)); + p = reallocarray(elem, newsize, sizeof(char *)); if (p == NULL) err(1, "no memory"); |