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

Martine Lenders notifications at github.com
Wed Jan 9 21:45:41 CET 2019


miri64 commented on this pull request.



> @@ -95,6 +95,10 @@ static int _parse_dns_reply(uint8_t *buf, size_t len, void* addr_out, int family
 
     /* skip all queries that are part of the reply */
     for (unsigned n = 0; n < ntohs(hdr->qdcount); n++) {
+        if (bufpos >= (buf + len)) {
+            /* out-of-bound */
+            return -EBADMSG;
+        }
         bufpos += _skip_hostname(bufpos);

I fixed `_skip_hostname()` to check the buffer bounds in e149b6a

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


More information about the notifications mailing list