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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user