summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-10-08 04:13:33 +0000
committerderaadt <deraadt@openbsd.org>2014-10-08 04:13:33 +0000
commitfc07d9cd821d3ce1ea324bee68b313105dddae96 (patch)
tree507d8148ac3c316b7925bfb3b1c09c996ade0c9d
parentuserland reallocarray audit. (diff)
downloadwireguard-openbsd-fc07d9cd821d3ce1ea324bee68b313105dddae96.tar.xz
wireguard-openbsd-fc07d9cd821d3ce1ea324bee68b313105dddae96.zip
reallocarray() to detect integer overflow; ok doug
-rw-r--r--usr.bin/bc/bc.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/bc/bc.y b/usr.bin/bc/bc.y
index 55c48fcfceb..39ed0cb3597 100644
--- a/usr.bin/bc/bc.y
+++ b/usr.bin/bc/bc.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: bc.y,v 1.44 2013/11/20 21:33:54 deraadt Exp $ */
+/* $OpenBSD: bc.y,v 1.45 2014/10/08 04:13:33 deraadt Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -1097,7 +1097,7 @@ main(int argc, char *argv[])
init();
setlinebuf(stdout);
- sargv = malloc(argc * sizeof(char *));
+ sargv = reallocarray(NULL, argc, sizeof(char *));
if (sargv == NULL)
err(1, NULL);