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.bin/pmdb/clit.c | |
parent | be524287dc216d876f995eddcaf32762c702c6e9 (diff) |
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
Diffstat (limited to 'usr.bin/pmdb/clit.c')
-rw-r--r-- | usr.bin/pmdb/clit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/pmdb/clit.c b/usr.bin/pmdb/clit.c index 249710f5d12..bef9bf28d62 100644 --- a/usr.bin/pmdb/clit.c +++ b/usr.bin/pmdb/clit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clit.c,v 1.5 2003/10/31 08:47:31 otto Exp $ */ +/* $OpenBSD: clit.c,v 1.6 2007/09/02 15:19:33 deraadt Exp $ */ /* * Copyright (c) 2002 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -186,7 +186,7 @@ cmdloop(void *arg) stop = 0; - if ((argv = malloc(sizeof(char *) * maxargs)) == NULL) + if ((argv = calloc(sizeof(char *), maxargs)) == NULL) err(1, "malloc"); while (!stop && (elline = el_gets(el, &cnt)) != NULL) { |