diff options
| author | Felipe Pena <felipe@php.net> | 2008-10-24 10:44:19 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2008-10-24 10:44:19 +0000 |
| commit | 66f75b6e8ea2f28b08e813372f33e7e2d0f56d2b (patch) | |
| tree | 4e10c34b4f11aec003abd1746f4082cf4bc172ee | |
| parent | 6849171a2d161604a2b6b2af9d3619677d600ff1 (diff) | |
| download | php-git-66f75b6e8ea2f28b08e813372f33e7e2d0f56d2b.tar.gz | |
- Fixed bug #46082 (stream_set_blocking() can cause a crash in some circumstances)
| -rw-r--r-- | main/network.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main/network.c b/main/network.c index 1ce446494f..7dc0954d39 100644 --- a/main/network.c +++ b/main/network.c @@ -1057,7 +1057,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 |
