- Fixed stack buffer overflow in socket_connect().

Found by: Mateusz Kocielski, Marek Kroemeke and Filip Palian
This commit is contained in:
Felipe Pena committed 2011-05-24 00:05:50 +00:00
1 parent 331a30997a
commit 89f893a95e
1 file changed
+5
+5
View File
@@ -1540,6 +1540,11 @@ PHP_FUNCTION(socket_connect)
break;
case AF_UNIX:
if (addr_len >= sizeof(s_un.sun_path)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Path too long", php_sock->type);
RETURN_FALSE;
}
memset(&s_un, 0, sizeof(struct sockaddr_un));
s_un.sun_family = AF_UNIX;