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 /bin/systrace/systrace.c | |
parent | be524287dc216d876f995eddcaf32762c702c6e9 (diff) |
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
Diffstat (limited to 'bin/systrace/systrace.c')
-rw-r--r-- | bin/systrace/systrace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/systrace/systrace.c b/bin/systrace/systrace.c index 37a52712f5c..8e2045c564a 100644 --- a/bin/systrace/systrace.c +++ b/bin/systrace/systrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: systrace.c,v 1.54 2006/07/02 12:34:15 sturm Exp $ */ +/* $OpenBSD: systrace.c,v 1.55 2007/09/02 15:19:08 deraadt Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -754,7 +754,7 @@ main(int argc, char **argv) if (pidattach == 0) { /* Run a command and attach to it */ - if ((args = malloc((argc + 1) * sizeof(char *))) == NULL) + if ((args = calloc(argc + 1, sizeof(char *))) == NULL) err(1, "malloc"); for (i = 0; i < argc; i++) |