diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-09-02 15:19:41 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-09-02 15:19:41 +0000 |
commit | 6ebd04219f0d749c87a763e8afb578dfcd5223cc (patch) | |
tree | bb0f29e0a3791fff88551c93f5d4ba7113bdba43 /usr.sbin/lpr/pac/pac.c | |
parent | be524287dc216d876f995eddcaf32762c702c6e9 (diff) |
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
Diffstat (limited to 'usr.sbin/lpr/pac/pac.c')
-rw-r--r-- | usr.sbin/lpr/pac/pac.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/lpr/pac/pac.c b/usr.sbin/lpr/pac/pac.c index 60d9d237f34..894699eef0b 100644 --- a/usr.sbin/lpr/pac/pac.c +++ b/usr.sbin/lpr/pac/pac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pac.c,v 1.17 2003/06/02 23:36:53 millert Exp $ */ +/* $OpenBSD: pac.c,v 1.18 2007/09/02 15:19:39 deraadt Exp $ */ /* $NetBSD: pac.c,v 1.14 2000/04/27 13:40:18 msaitoh Exp $ */ /* @@ -41,7 +41,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)pac.c 8.1 (Berkeley) 6/6/93"; #else -static const char rcsid[] = "$OpenBSD: pac.c,v 1.17 2003/06/02 23:36:53 millert Exp $"; +static const char rcsid[] = "$OpenBSD: pac.c,v 1.18 2007/09/02 15:19:39 deraadt Exp $"; #endif #endif /* not lint */ @@ -286,7 +286,7 @@ dumpit(void) hp = hashtab[0]; hno = 1; - base = (struct hent **) malloc(hcount * sizeof(hp)); + base = (struct hent **) calloc(hcount, sizeof(hp)); if (base == NULL) err(1, NULL); for (ap = base, c = hcount; c--; ap++) { |