From 6dc99d0e250ff7bbbd8457371330a3fca7fdb9b5 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 24 Aug 2009 21:25:06 +0000 Subject: [PATCH] Fix a typo in parse_fingerprint_file; after calling strpbrk we need to test teh return value, not the (unchanged) value we passed in. This would cause a segmentation fault instead of a fatal error if nmap-os-db ended in a Fingerprint line that didn't have a terminating newline. --- osscan.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osscan.cc b/osscan.cc index 77aeacd37..ef0384de3 100644 --- a/osscan.cc +++ b/osscan.cc @@ -1069,7 +1069,7 @@ while(fgets(line, sizeof(line), fp)) { while(*p && isspace((int) (unsigned char) *p)) p++; q = strpbrk(p, "\n#"); - if (!p) fatal("Parse error on line %d of fingerprint: %s", lineno, line); + if (!q) fatal("Parse error on line %d of fingerprint: %s", lineno, line); while(isspace((int) (unsigned char) *(--q))) ;