From 1ebaf59a9096cf1b90aa9e6b60aebc0fd79f218c Mon Sep 17 00:00:00 2001 From: bzt Date: Tue, 29 Mar 2022 18:39:46 +0200 Subject: [PATCH] Fixed issue #33 --- uefi/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uefi/string.c b/uefi/string.c index e24a691..3e346c4 100644 --- a/uefi/string.c +++ b/uefi/string.c @@ -95,7 +95,7 @@ void *memmem(const void *haystack, size_t hl, const void *needle, size_t nl) { uint8_t *c = (uint8_t*)haystack; if(!haystack || !needle || !hl || !nl || nl > hl) return NULL; - hl -= nl; + hl -= nl - 1; while(hl) { if(!memcmp(c, needle, nl)) return c; c++; hl--;