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

Avoid reading outside the provided range

This commit is contained in:
dmiller
2022-12-02 21:57:28 +00:00
parent d957ca1274
commit 7dcca32ff1

View File

@@ -125,7 +125,7 @@ const char *string_pool_substr(const char *s, const char *t)
}
const char *string_pool_substr_strip(const char *s, const char *t) {
while (isspace((int) (unsigned char) *s))
while (s < t && isspace((int) (unsigned char) *s))
s++;
while (t > s && isspace((int) (unsigned char) *(t - 1)))
t--;