1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 09:42:22 +01:00

Fixed bug #21529 (memory corruption by fsockopen()).

This commit is contained in:
Ilia Alshanetsky
2003-01-09 03:33:15 +00:00
parent 392e5013b4
commit ef9ba94c8b

View File

@@ -178,7 +178,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
if (zerrstr) {
zval_dtor(zerrstr);
ZVAL_STRING(zerrno, "", 1);
ZVAL_STRING(zerrstr, "", 1);
}
if (port > 0) { /* connect to a host */
@@ -261,6 +261,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
char *buf = php_socket_strerror(err, NULL, 0);
/* no need to dup; we would only need to efree buf anyway */
zval_dtor(zerrstr);
ZVAL_STRING(zerrstr, buf, 0);
}
RETURN_FALSE;