diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-08 16:27:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-08 16:27:54 +0000 |
commit | df286e24e09096f4a12604c1955b6ff694d0ae93 (patch) | |
tree | 1bc933d1f5551b3b574301c2605f36e32e4aff2f /sbin/fsck/fsck.c | |
parent | 2b5a08f3c8f5de99ab1bf29c70af81b6ede1a27f (diff) |
replace internal erealloc() with ereallocarray(), and then use it to
spot mult int overflow
Diffstat (limited to 'sbin/fsck/fsck.c')
-rw-r--r-- | sbin/fsck/fsck.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c index 207ddf8e5f7..83abc318c04 100644 --- a/sbin/fsck/fsck.c +++ b/sbin/fsck/fsck.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fsck.c,v 1.30 2014/07/13 17:28:13 jmc Exp $ */ +/* $OpenBSD: fsck.c,v 1.31 2014/10/08 16:27:53 deraadt Exp $ */ /* $NetBSD: fsck.c,v 1.7 1996/10/03 20:06:30 christos Exp $ */ /* @@ -455,7 +455,7 @@ mangle(char *opts, int *argcp, const char ***argvp, int *maxargcp) if (argc >= maxargc - 3) { int newmaxargc = maxargc + 50; - argv = erealloc(argv, newmaxargc * sizeof(char *)); + argv = ereallocarray(argv, newmaxargc, sizeof(char *)); maxargc = newmaxargc; } if (*p != '\0') { |