Skip to content

Commit 3c32af7

Browse files
authored
Merge pull request #1715 from fasterit/improve-filter-optarg-handling
Make empty --filter= command line arguments invalid
2 parents 8988cff + a808b58 commit 3c32af7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CommandLine.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettin
249249
}
250250
case 'F':
251251
assert(optarg);
252+
if (optarg[0] == '\0' || optarg[0] == '|') {
253+
fprintf(stderr, "Error: invalid filter value \"%s\".\n", optarg);
254+
return STATUS_ERROR_EXIT;
255+
}
252256
free_and_xStrdup(&flags->commFilter, optarg);
253257
break;
254258
case 'H': {

0 commit comments

Comments
 (0)