]> granicus.if.org Git - php/commitdiff
- MFH: Fixed bug #46082 (stream_set_blocking() can cause a crash in some circumstances)
authorFelipe Pena <felipe@php.net>
Fri, 24 Oct 2008 10:46:05 +0000 (10:46 +0000)
committerFelipe Pena <felipe@php.net>
Fri, 24 Oct 2008 10:46:05 +0000 (10:46 +0000)
NEWS
main/network.c

diff --git a/NEWS b/NEWS
index b3e1b1c7fd497ed12464a9f5897431b0ae379259..a8a3b49d88e316773c3bf7cee9aa15b985278ebf 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? Nov 2008, PHP 5.2.7RC3
+- Fixed bug #46082 (stream_set_blocking() can cause a crash in some
+  circumstances). (Felipe)
 
 23 Oct 2008, PHP 5.2.7RC2
 - Upgraded bundled libzip to 0.9.0. (Pierre)
index d0b710e56043949f590136e45be0053b1de14eb8..6c1028a6bd8d9788f44daae7e52e5bb85320db7a 100644 (file)
@@ -1051,7 +1051,11 @@ PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC)
        /* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */
        flags = !block;
        if (ioctlsocket(socketd, FIONBIO, &flags) == SOCKET_ERROR) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", WSAGetLastError());
+               char *error_string;
+               
+               error_string = php_socket_strerror(WSAGetLastError(), NULL, 0);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", error_string);
+               efree(error_string);
                ret = FAILURE;
        }
 #else