The command line option P takes one argument, which is supposed to
contain exactly one character. The current check performs an out
of boundary read if an empty string is supplied.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: https://github.com/kmod-project/kmod/pull/73
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
out = stdout;
break;
case 'P':
- if (optarg[1] != '\0') {
+ if (strlen(optarg) != 1) {
CRIT("-P only takes a single char\n");
goto cmdline_failed;
}