1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 10:59:02 +00:00

Use const and avoid strdup in fingerprint parsing

This commit is contained in:
dmiller
2022-09-13 16:10:05 +00:00
parent f44f255da3
commit 9a494348c5
4 changed files with 72 additions and 78 deletions

View File

@@ -128,13 +128,13 @@ const char *string_pool_substr_strip(const char *s, const char *t) {
return string_pool_substr(s, t);
}
const char *string_pool_strip_word(const char *s) {
const char *string_pool_strip_word(const char *s, const char *end) {
const char *t;
while (isspace((int) (unsigned char) *s))
s++;
t = s;
while (*t != '\0' && !isspace((int) (unsigned char) *t))
while (t < end && *t != '\0' && !isspace((int) (unsigned char) *t))
t++;
if (s == t)