mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Fix an out-of-bounds memory access when parsing PTR records
This commit is contained in:
parent
c9b7c2f590
commit
3adaa69cb2
1 changed files with 2 additions and 2 deletions
|
|
@ -1361,7 +1361,7 @@ bool DNS::Factory::ptrToIp(const std::string &ptr, sockaddr_storage &ip)
|
|||
size_t i = 0;
|
||||
|
||||
p--;
|
||||
while (i < sizeof(ip4->sin_addr.s_addr))
|
||||
while (p >= cptr && i < sizeof(ip4->sin_addr.s_addr))
|
||||
{
|
||||
if (*p == '.')
|
||||
{
|
||||
|
|
@ -1394,7 +1394,7 @@ bool DNS::Factory::ptrToIp(const std::string &ptr, sockaddr_storage &ip)
|
|||
size_t i=0;
|
||||
|
||||
p--;
|
||||
while (i < sizeof(ip6->sin6_addr.s6_addr))
|
||||
while (p >= cptr && i < sizeof(ip6->sin6_addr.s6_addr))
|
||||
{
|
||||
if (*p == '.')
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue