diff options
author | 2014-10-08 04:13:33 +0000 | |
---|---|---|
committer | 2014-10-08 04:13:33 +0000 | |
commit | fc07d9cd821d3ce1ea324bee68b313105dddae96 (patch) | |
tree | 507d8148ac3c316b7925bfb3b1c09c996ade0c9d | |
parent | userland reallocarray audit. (diff) | |
download | wireguard-openbsd-fc07d9cd821d3ce1ea324bee68b313105dddae96.tar.xz wireguard-openbsd-fc07d9cd821d3ce1ea324bee68b313105dddae96.zip |
reallocarray() to detect integer overflow; ok doug
-rw-r--r-- | usr.bin/bc/bc.y | 4 |
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); |