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>
This commit is contained in:
Rich Salz
2016-01-11 20:40:38 -05:00
committed by Rich Salz
parent 2bec39eb86
commit bd4850df64
5 changed files with 64 additions and 76 deletions

View File

@@ -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));