From e002e2ec1c653b7472a36450f2b6997f2b202b4e Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 3 Feb 2008 16:15:30 +0000 Subject: [PATCH] MFB: Fixed bug #44028 (crash inside stream_socket_enable_crypto() when enabling encryption without crypto type) --- NEWS | 2 ++ ext/standard/streamsfuncs.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/NEWS b/NEWS index c53610fdf4..88bc792baf 100644 --- 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 diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 4e683426a0..db3e0bbacc 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -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); -- 2.40.0