fix fct when called with a one byte array

This commit is contained in:
iceman1001 committed 2025-08-29 13:55:50 +02:00
1 parent c3e29789a9
commit 7414cdf359
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -1563,6 +1563,10 @@ int byte_strstr(const uint8_t *src, size_t srclen, const uint8_t *pattern, size_
continue;
}
if (plen == 1) {
return i;
}
// try to match rest of the pattern
for (int j = plen - 1; j >= 1; j--) {