summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoug <doug@openbsd.org>2014-10-08 04:02:46 +0000
committerdoug <doug@openbsd.org>2014-10-08 04:02:46 +0000
commit96c40bfdf56bf33ed732ddbdda823a292c2863ab (patch)
treedf0273b16d11d041e75ded59720b35d827da0fa7
parentuserland reallocarray audit. (diff)
downloadwireguard-openbsd-96c40bfdf56bf33ed732ddbdda823a292c2863ab.tar.xz
wireguard-openbsd-96c40bfdf56bf33ed732ddbdda823a292c2863ab.zip
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.c4
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;