]> granicus.if.org Git - php/commitdiff
- Removed redundant local variable in dns_get_record.
authorGustavo André dos Santos Lopes <cataphract@php.net>
Mon, 11 Oct 2010 03:07:03 +0000 (03:07 +0000)
committerGustavo André dos Santos Lopes <cataphract@php.net>
Mon, 11 Oct 2010 03:07:03 +0000 (03:07 +0000)
- (5.3) Fixed bug in the Windows implementation of
  dns_get_record, where the two last parameters wouldn't be
  filled unless the type were DNS_ANY (Gustavo).

NEWS
ext/standard/dns.c
ext/standard/dns_win32.c

diff --git a/NEWS b/NEWS
index 431e79c5b253ac4034afe8d3800e2d3169788bde..0a9c9d0b016756df9a1326b18ee32a90ff52ee4e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,8 @@
 - Changed the $context parameter on copy() to actually have an effect. (Kalle)
 - Fixed possible crash in mssql_fetch_batch(). (Kalle)
 - Fixed inconsistent backlog default value (-1) in FPM on many systems. (fat)
+- Fixed bug in the Windows implementation of dns_get_record, where the two
+  last parameters wouldn't be filled unless the type were DNS_ANY (Gustavo).
 
 - Fixed bug #53021 (In html_entity_decode, failure to convert numeric entities
   with ENT_NOQUOTES and ISO-8859-1). Fixed and extended the fix of ENT_NOQUOTES 
index 103d6904f8ed072b0045e568cc1f01681d875ac1..1a3455f59002b13c6cefa1e2a9acece45d5b3318 100644 (file)
@@ -697,7 +697,6 @@ PHP_FUNCTION(dns_get_record)
        int hostname_len;
        long type_param = PHP_DNS_ANY;
        zval *authns = NULL, *addtl = NULL;
-       int addtl_recs = 0;
        int type_to_fetch;
 #if defined(HAVE_DNS_SEARCH)
        struct sockaddr_storage from;
@@ -724,7 +723,6 @@ PHP_FUNCTION(dns_get_record)
        if (addtl) {
                zval_dtor(addtl);
                array_init(addtl);
-               addtl_recs = 1;
        }
 
        if (type_param & ~PHP_DNS_ALL && type_param != PHP_DNS_ANY) {
@@ -742,7 +740,7 @@ PHP_FUNCTION(dns_get_record)
         * - In case of PHP_DNS_ANY we use the directly fetch DNS_T_ANY. (step NUMTYPES+1 )
         */
        for (type = (type_param == PHP_DNS_ANY ? (PHP_DNS_NUM_TYPES + 1) : 0);
-               type < (addtl_recs ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query;
+               type < (addtl ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query;
                type++
        ) {
                first_query = 0;
@@ -858,7 +856,7 @@ PHP_FUNCTION(dns_get_record)
                                }
                        }
 
-                       if (addtl_recs && addtl) {
+                       if (addtl) {
                                /* Additional records associated with authoritative name servers */
                                while (ar-- > 0 && cp && cp < end) {
                                        zval *retval = NULL;
index ac3aab00b17aa05bded1ab70e7798275a997dd80..a6e5b0a4838ace4b35a9afb8c99e192d5aa6220a 100644 (file)
@@ -337,7 +337,6 @@ PHP_FUNCTION(dns_get_record)
        long type_param = PHP_DNS_ANY;
        zval *authns = NULL, *addtl = NULL;
        int type, type_to_fetch, first_query = 1, store_results = 1;
-       int addtl_recs = 0;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lzz", &hostname, &hostname_len, &type_param, &authns, &addtl) == FAILURE) {
                return;
@@ -361,7 +360,7 @@ PHP_FUNCTION(dns_get_record)
        array_init(return_value);
 
        for (type = (type_param == PHP_DNS_ANY ? (PHP_DNS_NUM_TYPES + 1) : 0);
-               type < (addtl_recs ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query;
+               type < (addtl ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query;
                type++
        ) {
                DNS_STATUS      status;                 /* Return value of DnsQuery_A() function */