CWE-394 / https://cwe.mitre.org/data/definitions/394.html
Note: optparse_init() and optparse_long() which can modify the
'options' variable in rrd_tune() can never set options.optind
to a negative value.
opt_daemon = NULL;
}
- if (options.optind < 0 || options.optind >= options.argc) {
+ if (!options.optind || options.optind >= options.argc) {
// missing file name...
rrd_set_error("missing file name");
goto done;
}
optind = handle_modify(&rrd, in_filename, options.argc, options.argv, options.optind + 1, opt_newstep);
- if (options.optind < 0) {
- goto done;
- }
-
rc = 0;
done:
if (in_filename && rrdc_is_any_connected()) {