mirror of
https://github.com/nmap/nmap.git
synced 2026-08-27 03:48:14 +00:00
Correctly handle root domain label. Credit: Himanshu Anand
This commit is contained in:
parent
fcabd66198
commit
8769ab35f3
2 changed files with 42 additions and 2 deletions
|
|
@ -1974,8 +1974,13 @@ size_t DNS::Factory::parseDomainName(std::string &name, const u8 *buf, size_t of
|
|||
max_offset++;
|
||||
}
|
||||
|
||||
std::string::iterator it = name.end()-1;
|
||||
if( *it == '.') name.erase(it);
|
||||
if (name.empty()) {
|
||||
name = ".";
|
||||
}
|
||||
else {
|
||||
std::string::iterator it = name.end()-1;
|
||||
if( *it == '.') name.erase(it);
|
||||
}
|
||||
|
||||
return max_offset - offset;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue