[riot-notifications] [RIOT-OS/RIOT] sock_dns: fix out-of-bound errors (#10740)

PyroPeter notifications at github.com
Wed Jan 9 22:34:44 CET 2019


pyropeter commented on this pull request.



> @@ -129,6 +131,13 @@ static int _parse_dns_reply(uint8_t *buf, size_t len, void* addr_out, int family
             bufpos += addrlen;
             continue;
         }
+        if (addrlen > SOCK_DNS_MAX_ADDR_LEN) {
+            return -EINVAL;

This code is only reached for `IN/A` and `IN/AAAA`, whose lengths must be exactly 4 or 16 bytes, as mandated by RFC1035 and RFC3596, respectivly.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10740#discussion_r246547287
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190109/954ec656/attachment.html>


More information about the notifications mailing list