php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #64330
Patch quick-fix-abstract-ns-xp_socket.c.patch revision 2013-03-01 09:02 UTC by a dot yamanoi at gmail dot com

Patch quick-fix-abstract-ns-xp_socket.c.patch for Streams related Bug #64330

Patch version 2013-03-01 09:02 UTC

Return to Bug #64330 | Download this patch
Patch Revisions:

Developer: a.yamanoi@gmail.com

diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index beffc73..5cda3ef 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -588,7 +588,7 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
 
 		parse_unix_address(xparam, &unix_addr TSRMLS_CC);
 
-		return bind(sock->socket, (struct sockaddr *)&unix_addr, sizeof(unix_addr));
+		return bind(sock->socket, (struct sockaddr *)&unix_addr, (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen);
 	}
 #endif
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC