1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-28 17:19:05 +00:00

Fix a couple off-by-one errors in parse_single_fingerprint

This commit is contained in:
dmiller
2022-12-02 21:57:31 +00:00
parent a94287c4dd
commit 12bb86e678

View File

@@ -930,8 +930,8 @@ FingerPrint *parse_single_fingerprint(const FingerPrintDB *DB, const char *fprin
while (p < nextline && isspace((int) (unsigned char) *p))
p++;
q = nextline ? nextline : end;
while (q > p && isspace((int) (unsigned char) *q))
q = nextline;
while (q > p && isspace((int) (unsigned char) *(q - 1)))
q--;
FP->match.OS_name = cp_strndup(p, q - p);
@@ -965,7 +965,7 @@ FingerPrint *parse_single_fingerprint(const FingerPrintDB *DB, const char *fprin
fatal("Parse error on line %d of fingerprint: %.*s\n", lineno, (int)(nextline - thisline), thisline);
}
thisline = nextline; /* Time to handle the next line, if there is one */
thisline = nextline + 1; /* Time to handle the next line, if there is one */
lineno++;
} while (thisline && thisline < end);