mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-03 05:44:14 +00:00
Fixed off-by-one
This commit is contained in:
parent
97bf1c914e
commit
570e573f0d
1 changed files with 2 additions and 2 deletions
|
@ -136,12 +136,12 @@ void parse_dns_response(const struct arguments *args, const struct ng_session *s
|
||||||
|
|
||||||
char rd[INET6_ADDRSTRLEN + 1];
|
char rd[INET6_ADDRSTRLEN + 1];
|
||||||
if (qtype == DNS_QTYPE_A) {
|
if (qtype == DNS_QTYPE_A) {
|
||||||
if (off + sizeof(__be32) < *datalen)
|
if (off + sizeof(__be32) <= *datalen)
|
||||||
inet_ntop(AF_INET, data + off, rd, sizeof(rd));
|
inet_ntop(AF_INET, data + off, rd, sizeof(rd));
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
} else if (qclass == DNS_QCLASS_IN && qtype == DNS_QTYPE_AAAA) {
|
} else if (qclass == DNS_QCLASS_IN && qtype == DNS_QTYPE_AAAA) {
|
||||||
if (off + sizeof(struct in6_addr) < *datalen)
|
if (off + sizeof(struct in6_addr) <= *datalen)
|
||||||
inet_ntop(AF_INET6, data + off, rd, sizeof(rd));
|
inet_ntop(AF_INET6, data + off, rd, sizeof(rd));
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue