The pattern match "found" fails to parse on binary type samples. The
reason is that it presents itself as an integer type which bin cannot
be cast into. We must always accept this match since it validates
anything on input regardless of the type. Let's just relax the parser
to accept it.
This problem might also exist in 1.5.
(cherry picked from commit
91cc2368a73198bddc3e140d267cce4ee08cf20e)
}
/* Note: -m found is always valid, bool/int are compatible, str/bin/reg/len are compatible */
- if (!sample_casts[cur_type][pat_match_types[idx]]) {
+ if (idx != PAT_MATCH_FOUND && !sample_casts[cur_type][pat_match_types[idx]]) {
memprintf(err, "matching method '%s' cannot be used with fetch keyword '%s'", args[1], expr->kw);
goto out_free_expr;
}