andrei          Thu Jun  4 18:17:28 2009 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/sockets        sockets.c 
  Log:
  Fix invalid test against addr6 result.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.25&r2=1.171.2.9.2.26&diff_format=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.25 
php-src/ext/sockets/sockets.c:1.171.2.9.2.26
--- php-src/ext/sockets/sockets.c:1.171.2.9.2.25        Wed May 20 09:06:31 2009
+++ php-src/ext/sockets/sockets.c       Thu Jun  4 18:17:28 2009
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sockets.c,v 1.171.2.9.2.25 2009/05/20 09:06:31 lbarnaud Exp $ */
+/* $Id: sockets.c,v 1.171.2.9.2.26 2009/06/04 18:17:28 andrei Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1466,10 +1466,11 @@
                        zval_dtor(arg5);
                        zval_dtor(arg6);
 
+                       memset(addr6, 0, INET6_ADDRSTRLEN);
                        inet_ntop(AF_INET6, &sin6.sin6_addr, addr6, 
INET6_ADDRSTRLEN);
 
                        ZVAL_STRINGL(arg2, recv_buf, retval, 0);
-                       ZVAL_STRING(arg5, addr6 ? addr6 : "::", 1);
+                       ZVAL_STRING(arg5, addr6[0] ? addr6 : "::", 1);
                        ZVAL_LONG(arg6, ntohs(sin6.sin6_port));
                        break;
 #endif



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

Reply via email to