summaryrefslogtreecommitdiff
path: root/bin/tools/genrandom.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/tools/genrandom.c')
-rw-r--r--bin/tools/genrandom.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/tools/genrandom.c b/bin/tools/genrandom.c
index 0d7eb726d6de2..7a6c64153ee79 100644
--- a/bin/tools/genrandom.c
+++ b/bin/tools/genrandom.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007, 2009, 2010, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2009, 2010, 2012, 2014 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -120,7 +120,9 @@ main(int argc, char **argv) {
return (0);
}
- len = strlen(argv[isc_commandline_index]) + 2;
+ len = strlen(argv[isc_commandline_index]);
+ INSIST((len + 2) > len);
+ len += 2;
name = (char *) malloc(len);
if (name == NULL) {
perror("malloc");