diff options
author | Doug Hogan <doug@cvs.openbsd.org> | 2014-10-08 04:02:47 +0000 |
---|---|---|
committer | Doug Hogan <doug@cvs.openbsd.org> | 2014-10-08 04:02:47 +0000 |
commit | 5bb938e812205cce167f4b1bb9cae332ecb87820 (patch) | |
tree | 525039eeddd310755dbd5cb879dd2812bb42e40d | |
parent | dd7fa3c3f7e1d7352540477d3e783c24982a7e23 (diff) |
userland reallocarray audit.
Replace malloc() and realloc() calls that may have integer overflow in the
multiplication of the arguments with reallocarray().
ok deraadt@
-rw-r--r-- | usr.bin/kdump/kdump.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index dcc04c3f288..610793e442e 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kdump.c,v 1.89 2014/09/17 19:12:55 guenther Exp $ */ +/* $OpenBSD: kdump.c,v 1.90 2014/10/08 04:02:46 doug Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -311,7 +311,7 @@ mappidtoemul(pid_t pid, struct emulation *emul) return; } } - tmp = realloc(pe_table, (pe_size + 1) * sizeof(*pe_table)); + tmp = reallocarray(pe_table, pe_size + 1, sizeof(*pe_table)); if (tmp == NULL) err(1, NULL); pe_table = tmp; |