diff --git a/src/goodbyedpi.c b/src/goodbyedpi.c index 016e9184..18c1c282 100644 --- a/src/goodbyedpi.c +++ b/src/goodbyedpi.c @@ -182,10 +182,7 @@ static char *filter_passive_string = NULL; static void *memmem(const void *haystack, size_t haystack_len, const void * const needle, const size_t needle_len) { - if (haystack == NULL) return NULL; // or assert(haystack != NULL); - if (haystack_len == 0) return NULL; - if (needle == NULL) return NULL; // or assert(needle != NULL); - if (needle_len == 0) return NULL; + if (needle_len > haystack_len) return NULL; for (const char *h = haystack; haystack_len >= needle_len;