]> granicus.if.org Git - php/commitdiff
Fix bug #46748, segfault when SSL has more than one error message.
authorScott MacVicar <scottmac@php.net>
Mon, 8 Dec 2008 02:33:46 +0000 (02:33 +0000)
committerScott MacVicar <scottmac@php.net>
Mon, 8 Dec 2008 02:33:46 +0000 (02:33 +0000)
NEWS
ext/openssl/xp_ssl.c

diff --git a/NEWS b/NEWS
index 4dde03ba2bb1463b5767ad2774cc1f62bad27370..e79f7cb3fbc4b3af34964a5986bfc82c00b13efd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2009, PHP 5.2.9
 - Fixed bug #46782 (fastcgi.c parse error). (Matt)
+- Fixed bug #46748 (Segfault when an SSL error has more than one error.) (Scott)
 - Fixed bug #46739 (array returned by curl_getinfo should contain content_type key). 
   (Mikko)
 
index 6b052ec73a943aa46691f2df6ffa0592f9eceb93..f8fcb6d133612ee19df05cd641a173de3738cdce 100644 (file)
@@ -152,9 +152,10 @@ static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init
                                                        ERR_error_string_n(ecode, esbuf, sizeof(esbuf) - 1);
                                                }
                                                code = strlen(esbuf);
-                                               esbuf[code] = '\0';
 
                                                ebuf = erealloc(ebuf, ebuf_size + code + 1);
+                                               ebuf_size += code;
+
                                                if (wptr == NULL) {
                                                        wptr = ebuf;
                                                }