summaryrefslogtreecommitdiffstats
path: root/apps/rand.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2016-01-12 02:40:38 +0100
committerRich Salz <rsalz@openssl.org>2016-01-12 07:00:31 +0100
commitbd4850df648bee9d8e0595b7e1147266e6f55a3e (patch)
tree4a62e47c26c25cd7b55418cf7fb3b9c7ba9fc45f /apps/rand.c
parentYet another make update. (diff)
downloadopenssl-bd4850df648bee9d8e0595b7e1147266e6f55a3e.tar.xz
openssl-bd4850df648bee9d8e0595b7e1147266e6f55a3e.zip
RT4227: Range-check in apps.
Implement range-checking in all counts in apps. Turns out only a couple of cases were missing. And make the range-checking code more strict. Replace almost all opt_ulong() calls with opt_long() Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Diffstat (limited to 'apps/rand.c')
-rw-r--r--apps/rand.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/apps/rand.c b/apps/rand.c
index 150eef4fb1..bd6fdff123 100644
--- a/apps/rand.c
+++ b/apps/rand.c
@@ -121,9 +121,7 @@ int rand_main(int argc, char **argv)
argc = opt_num_rest();
argv = opt_rest();
- if (argc != 1)
- goto opthelp;
- if (sscanf(argv[0], "%d", &num) != 1 || num < 0)
+ if (argc != 1 || !opt_int(argv[0], &num) || num < 0)
goto opthelp;
app_RAND_load_file(NULL, (inrand != NULL));