mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
Adjust ipaddr length by 1 byte (null already accounted for)
This commit is contained in:
@@ -986,7 +986,7 @@ static void parse_resolvdotconf() {
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
char buf[2048], *tp;
|
char buf[2048], *tp;
|
||||||
char fmt[32];
|
char fmt[32];
|
||||||
char ipaddr[INET6_ADDRSTRLEN+1];
|
char ipaddr[INET6_ADDRSTRLEN];
|
||||||
|
|
||||||
fp = fopen("/etc/resolv.conf", "r");
|
fp = fopen("/etc/resolv.conf", "r");
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
@@ -994,7 +994,7 @@ static void parse_resolvdotconf() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Snprintf(fmt, sizeof(fmt), "nameserver %%%us", INET6_ADDRSTRLEN);
|
Snprintf(fmt, sizeof(fmt), "nameserver %%%us", INET6_ADDRSTRLEN-1);
|
||||||
|
|
||||||
while (fgets(buf, sizeof(buf), fp)) {
|
while (fgets(buf, sizeof(buf), fp)) {
|
||||||
tp = buf;
|
tp = buf;
|
||||||
|
|||||||
Reference in New Issue
Block a user