mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +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:
parent
6725a34200
commit
d22dbc63b8
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue