summaryrefslogtreecommitdiff
path: root/ext/sockets
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2009-06-04 18:17:43 +0000
committerAndrei Zmievski <andrei@php.net>2009-06-04 18:17:43 +0000
commit1787a2272a7d9f3f7c7932f61b57054755e99135 (patch)
tree1d61027e96d8ea755ddc5516a84e9d84ae794e84 /ext/sockets
parentb8d64e408505a39888107e0b0d7445498d46250b (diff)
downloadphp-git-1787a2272a7d9f3f7c7932f61b57054755e99135.tar.gz
MFB
Diffstat (limited to 'ext/sockets')
-rw-r--r--ext/sockets/sockets.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 81a3f31f05..abc6438e9f 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -1611,10 +1611,11 @@ PHP_FUNCTION(socket_recvfrom)
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