mirror of
https://github.com/nmap/nmap.git
synced 2026-01-08 23:49:03 +00:00
Don't ever print out a FingerPrint line in fp2ascii (this was never used, and
in fact was worked around in several places fp2ascii was called). Ignore a second Fingerprint line in parse_single_fingerprint.
This commit is contained in:
29
osscan.cc
29
osscan.cc
@@ -765,17 +765,10 @@ static char str[2048];
|
||||
FingerPrint *current;
|
||||
struct AVal *AV;
|
||||
char *p = str;
|
||||
int len;
|
||||
memset(str, 0, sizeof(str));
|
||||
|
||||
if (!FP) return "(None)";
|
||||
|
||||
if(FP->OS_name && *(FP->OS_name)) {
|
||||
len = Snprintf(str, 128, "FingerPrint %s\n", FP->OS_name);
|
||||
if (len < 0) fatal("OS name too long");
|
||||
p += len;
|
||||
}
|
||||
|
||||
for(current = FP; current ; current = current->next) {
|
||||
Strncpy(p, current->name, sizeof(str) - (p-str));
|
||||
p += strlen(p);
|
||||
@@ -905,18 +898,20 @@ FingerPrint *parse_single_fingerprint(char *fprint_orig) {
|
||||
}
|
||||
|
||||
if (strncmp(thisline, "Fingerprint ", 12) == 0) {
|
||||
p = thisline + 12;
|
||||
while(*p && isspace((int) *p)) p++;
|
||||
/* Ignore a second Fingerprint line if it appears. */
|
||||
if (FP->OS_name == NULL) {
|
||||
p = thisline + 12;
|
||||
while(*p && isspace((int) *p)) p++;
|
||||
|
||||
q = strchr(p, '\n');
|
||||
if (!q) q = p + strlen(p);
|
||||
while(q > p && isspace(*(--q)))
|
||||
;
|
||||
q = strchr(p, '\n');
|
||||
if (!q) q = p + strlen(p);
|
||||
while(q > p && isspace(*(--q)))
|
||||
;
|
||||
|
||||
FP->OS_name = (char *) cp_alloc(q - p + 2);
|
||||
memcpy(FP->OS_name, p, q - p + 1);
|
||||
FP->OS_name[q - p + 1] = '\0';
|
||||
|
||||
FP->OS_name = (char *) cp_alloc(q - p + 2);
|
||||
memcpy(FP->OS_name, p, q - p + 1);
|
||||
FP->OS_name[q - p + 1] = '\0';
|
||||
}
|
||||
} else if (strncmp(thisline, "Class ", 6) == 0) {
|
||||
|
||||
parse_classline(FP, thisline, lineno, &classno);
|
||||
|
||||
Reference in New Issue
Block a user