pajoye                                   Wed, 08 Sep 2010 10:25:40 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=303166

Log:
- Fix bug #52323, return value of php_network_connect_socket should be set even 
if the caller does not care about the error_string

Bug: http://bugs.php.net/52323 (Feedback) php_network_connect_socket doesn't 
return all errors correctly
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/main/network.c
    U   php/php-src/trunk/main/network.c

Modified: php/php-src/branches/PHP_5_3/main/network.c
===================================================================
--- php/php-src/branches/PHP_5_3/main/network.c 2010-09-08 09:57:20 UTC (rev 
303165)
+++ php/php-src/branches/PHP_5_3/main/network.c 2010-09-08 10:25:40 UTC (rev 
303166)
@@ -377,8 +377,10 @@
        }

        if (error && error_string) {
-               *error_string = php_socket_strerror(error, NULL, 0);
                ret = -1;
+               if (error_string) {
+                       *error_string = php_socket_strerror(error, NULL, 0);
+               }
        }
        return ret;
 #else

Modified: php/php-src/trunk/main/network.c
===================================================================
--- php/php-src/trunk/main/network.c    2010-09-08 09:57:20 UTC (rev 303165)
+++ php/php-src/trunk/main/network.c    2010-09-08 10:25:40 UTC (rev 303166)
@@ -377,8 +377,10 @@
        }

        if (error && error_string) {
-               *error_string = php_socket_strerror(error, NULL, 0);
                ret = -1;
+               if (error_string) {
+                       *error_string = php_socket_strerror(error, NULL, 0);
+               }
        }
        return ret;
 #else

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to