From 4baf608fd636624504c6a9c9389294023073ba9f Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Sat, 8 Aug 2020 19:42:58 -0700 Subject: Check for too long haystack Fixes #145 --- src/match.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/match.c') diff --git a/src/match.c b/src/match.c index a0c0785..d618f0a 100644 --- a/src/match.c +++ b/src/match.c @@ -56,7 +56,7 @@ static void setup_match_struct(struct match_struct *match, const char *needle, c match->needle_len = strlen(needle); match->haystack_len = strlen(haystack); - if (match->needle_len > MATCH_MAX_LEN || match->needle_len > match->haystack_len) { + if (match->haystack_len > MATCH_MAX_LEN || match->needle_len > match->haystack_len) { return; } -- cgit v1.2.3