]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #44028 (crash inside stream_socket_enable_crypto() when
authorIlia Alshanetsky <iliaa@php.net>
Sun, 3 Feb 2008 16:15:30 +0000 (16:15 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 3 Feb 2008 16:15:30 +0000 (16:15 +0000)
enabling encryption without crypto type)

NEWS
ext/standard/streamsfuncs.c

diff --git a/NEWS b/NEWS
index c53610fdf42111790999f84433319199c79531b0..88bc792baf1a1c2db5deeffd0afac432b94beb9a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ PHP                                                                        NEWS
   which to group by data is specified. (Ilia)
 - Upgraded PCRE to version 7.6 (Nuno)
 
+- Fixed bug #44028 (crash inside stream_socket_enable_crypto() when enabling  
+  encryption without crypto type). (Ilia)
 - Fixed bug #43981 (gmp_div_r() does not preserve the sign of 1st argument).
   (Ilia)
 - Fixed bug #43954 (Memory leak when sending the same HTTP status code
index 4e683426a0a3b043bda1c30a9c89dbad907313eb..db3e0bbacca65197241afb1a3e5bb4930e4e180f 100644 (file)
@@ -1325,6 +1325,9 @@ PHP_FUNCTION(stream_socket_enable_crypto)
                if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream TSRMLS_CC) < 0) {
                        RETURN_FALSE;
                }
+       } else if (enable) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "When enabling encryption you must specify the crypto type");
+               RETURN_FALSE;
        }
 
        ret = php_stream_xport_crypto_enable(stream, enable TSRMLS_CC);