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

Martine Lenders notifications at github.com
Thu Jan 10 10:54:31 CET 2019


miri64 commented on this pull request.



>          /* skip unwanted answers */
         if ((class != DNS_CLASS_IN) ||
                 ((_type == DNS_TYPE_A) && (family == AF_INET6)) ||
                 ((_type == DNS_TYPE_AAAA) && (family == AF_INET)) ||
                 ! ((_type == DNS_TYPE_A) || ((_type == DNS_TYPE_AAAA))
                     )) {
+            if ((bufpos + addrlen) < buf) {
+                /* buffer wraps around memory space */
+                return -EBADMSG;
+            }

> Adding -fwrapv to CFLAGS works with both GCC and clang and turns sanity back on. Maybe we should consider adding -fwrapv to the CFLAGS then?

@maribu do you want to open an issue or PR for that to discuss it?

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


More information about the notifications mailing list