]> git.saurik.com Git - apple/libresolv.git/commitdiff
libresolv-46.1.tar.gz mac-os-x-1073 mac-os-x-1074 mac-os-x-1075 v46.1
authorApple <opensource@apple.com>
Thu, 3 Nov 2011 23:31:40 +0000 (23:31 +0000)
committerApple <opensource@apple.com>
Thu, 3 Nov 2011 23:31:40 +0000 (23:31 +0000)
dns_util.c

index 614d6239eb487929740d3ebe39eb1102a9ef5d90..f44a00839b029c959fe70832057d361dc778a7db 100644 (file)
@@ -349,6 +349,12 @@ _dns_parse_resource_record_internal(const char *p, char **x, int32_t *remaining)
 
        *remaining -= 10;
 
+       if (*remaining < rdlen)
+       {
+               dns_free_resource_record(r);
+               return NULL;
+       }
+
        eor = *x;
        r->data.A = NULL;
 
@@ -709,12 +715,6 @@ _dns_parse_resource_record_internal(const char *p, char **x, int32_t *remaining)
 
                case ns_t_null:
                default:
-                       if (*remaining < rdlen)
-                       {
-                               dns_free_resource_record(r);
-                               return NULL;
-                       }
-
                        *remaining -= rdlen;
 
                        size = sizeof(dns_raw_resource_record_t);