From: Ilia Alshanetsky Date: Sun, 3 Feb 2008 16:14:44 +0000 (+0000) Subject: MFB: Fixed bug #44028 (crash inside stream_socket_enable_crypto() when X-Git-Tag: RELEASE_2_0_0a1~641 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb738d95bf963dbb6f097b61e5de946636303dfd;p=php MFB: Fixed bug #44028 (crash inside stream_socket_enable_crypto() when enabling encryption without crypto type) --- diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 4ad46d4ff9..98671a8501 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1487,6 +1487,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);