Browse Source

really don't blow up

PHP-5.1
Wez Furlong 22 years ago
parent
commit
e1f3beaa13
  1. 7
      ext/standard/streamsfuncs.c

7
ext/standard/streamsfuncs.c

@ -250,7 +250,7 @@ PHP_FUNCTION(stream_socket_accept)
if (peername) {
zval_dtor(peername);
ZVAL_STRING(peername, "", 0);
ZVAL_NULL(peername);
}
if (0 == php_stream_xport_accept(stream, &clistream,
@ -260,6 +260,7 @@ PHP_FUNCTION(stream_socket_accept)
&tv, &errstr
TSRMLS_CC) && clistream) {
Z_TYPE_P(peername) = IS_STRING;
php_stream_to_zval(clistream, return_value);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "accept failed: %s", errstr ? errstr : "Unknown error");
@ -270,10 +271,6 @@ PHP_FUNCTION(stream_socket_accept)
if (errstr) {
efree(errstr);
}
if (peername && Z_STRVAL_P(peername) == NULL) {
ZVAL_STRING(peername, "", 1);
}
}
/* }}} */

Loading…
Cancel
Save