fix rejection of dns responses with pointers past 512 byte offset
[musl] / src / network / ns_parse.c
index 3ff33a8..d01da47 100644 (file)
@@ -95,7 +95,7 @@ int ns_skiprr(const unsigned char *ptr, const unsigned char *eom, ns_sect sectio
                        p += r;
                }
        }
-       return ptr - p;
+       return p - ptr;
 bad:
        errno = EMSGSIZE;
        return -1;