1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-04 21:59:02 +00:00

Adds a necessary search restart to custom strcasestr().

Previously needle "ab" would not be found in haystack "aab".
This commit is contained in:
nnposter
2018-08-25 22:39:36 +00:00
parent 6725a34200
commit d22dbc63b8

View File

@@ -171,8 +171,10 @@ char *strcasestr(const char *haystack, const char *pneedle) {
free(needle);
return (char *)(p - needlelen + 1);
}
} else
} else {
p -= foundto - needle;
foundto = needle;
}
}
if (needlelen >= sizeof(buf))
free(needle);