Skip to content

Commit de0da09

Browse files
authored
fix(fuzz): handle bare "invalid argument" (#899)
OSS-Fuzz finding #471520156 had an assert caused by the time.LoadLocation outputting "invalid argument" for a null byte argument. The fuzz test was already intentionally skipping "invalid argument for" as a regex, which didn't match this err string. Changes: - Simplify regex to match both "invalid argument for X" and bare form - Remove redundant "operator in" pattern (covered by wildcard variant) Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
1 parent 13c5b65 commit de0da09

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/fuzz/fuzz_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func FuzzExpr(f *testing.F) {
2626
regexp.MustCompile(`error parsing regexp`),
2727
regexp.MustCompile(`integer divide by zero`),
2828
regexp.MustCompile(`interface conversion`),
29-
regexp.MustCompile(`invalid argument for .*`),
29+
regexp.MustCompile(`invalid argument`),
3030
regexp.MustCompile(`invalid character`),
3131
regexp.MustCompile(`invalid operation`),
3232
regexp.MustCompile(`invalid duration`),
@@ -46,7 +46,6 @@ func FuzzExpr(f *testing.F) {
4646
regexp.MustCompile(`reflect: string index out of range`),
4747
regexp.MustCompile(`strings: negative Repeat count`),
4848
regexp.MustCompile(`strings: illegal bytes to escape`),
49-
regexp.MustCompile(`operator "in" not defined on int`),
5049
regexp.MustCompile(`invalid date .*`),
5150
regexp.MustCompile(`cannot parse .* as .*`),
5251
regexp.MustCompile(`operator "in" not defined on .*`),

0 commit comments

Comments
 (0)