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

Martine Lenders notifications at github.com
Wed Jan 9 21:43:33 CET 2019


miri64 commented on this pull request.



> @@ -108,8 +112,11 @@ static int _parse_dns_reply(uint8_t *buf, size_t len, void* addr_out, int family
         bufpos += 4; /* skip ttl */
 
         unsigned addrlen = ntohs(_get_short(bufpos));
+        if (addrlen > SOCK_DNS_MAX_ADDR_LEN) {
+            return -EINVAL;
+        }

Ah, I could just move the class/type check up.

-- 
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_r246511886
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190109/3d5d35f6/attachment.html>


More information about the notifications mailing list