diff options
author | 2007-09-02 15:19:07 +0000 | |
---|---|---|
committer | 2007-09-02 15:19:07 +0000 | |
commit | 1ed98fdf61d9dd29369f246109081408082ce54d (patch) | |
tree | ad7631e58c83830d1fc51cbadb9a2da53c1abfb7 /usr.bin/awk/b.c | |
parent | OpenCVS server init-support with OpenCVS and GNU cvs clients. (diff) | |
download | wireguard-openbsd-1ed98fdf61d9dd29369f246109081408082ce54d.tar.xz wireguard-openbsd-1ed98fdf61d9dd29369f246109081408082ce54d.zip |
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
Diffstat (limited to 'usr.bin/awk/b.c')
-rw-r--r-- | usr.bin/awk/b.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/awk/b.c b/usr.bin/awk/b.c index 1cabd9f017e..9c1e96f166b 100644 --- a/usr.bin/awk/b.c +++ b/usr.bin/awk/b.c @@ -1,4 +1,4 @@ -/* $OpenBSD: b.c,v 1.13 2006/03/19 18:17:11 pvalchev Exp $ */ +/* $OpenBSD: b.c,v 1.14 2007/09/02 15:19:31 deraadt Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -84,8 +84,8 @@ fa *makedfa(const char *s, int anchor) /* returns dfa for reg expr s */ if (setvec == 0) { /* first time through any RE */ maxsetvec = MAXLIN; - setvec = (int *) malloc(maxsetvec * sizeof(int)); - tmpset = (int *) malloc(maxsetvec * sizeof(int)); + setvec = (int *) calloc(maxsetvec, sizeof(int)); + tmpset = (int *) calloc(maxsetvec, sizeof(int)); if (setvec == 0 || tmpset == 0) overflo("out of space initializing makedfa"); } |