summaryrefslogtreecommitdiff
path: root/ext/standard/fsock.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-01-09 03:33:15 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-01-09 03:33:15 +0000
commitef9ba94c8b42ecffa6f654a0c7900df080bc8442 (patch)
treeeafe534678dd2ff1f09823cec34ed97d240eb9bd /ext/standard/fsock.c
parent392e5013b4442fba575f6e02f01d81db5fbb02cd (diff)
downloadphp-git-ef9ba94c8b42ecffa6f654a0c7900df080bc8442.tar.gz
Fixed bug #21529 (memory corruption by fsockopen()).
Diffstat (limited to 'ext/standard/fsock.c')
-rw-r--r--ext/standard/fsock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index dd08714a37..d1f37a46dc 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -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;