]> granicus.if.org Git - php/commitdiff
Remove leftover check
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 20 Jun 2019 14:46:26 +0000 (16:46 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 20 Jun 2019 15:24:22 +0000 (17:24 +0200)
This is checked below now in a way that handles misaligned pointers.

ext/standard/dns.c

index 9ab1e138dec934d358093bbba32f66fd8fe82e6e..d461a39c34eb0d3028080134b3ed5b0f8aa11e7b 100644 (file)
@@ -254,7 +254,7 @@ PHP_FUNCTION(gethostbynamel)
 
        array_init(return_value);
 
-       for (i = 0; hp->h_addr_list[i] != 0 ; i++) {
+       for (i = 0;; i++) {
                /* On macos h_addr_list entries may be misaligned. */
                struct in_addr *h_addr_entry; /* Don't call this h_addr, it's a macro! */
                memcpy(&h_addr_entry, &hp->h_addr_list[i], sizeof(struct in_addr *));