From c466f232bca7f32a4f97eb02541ecb197168b760 Mon Sep 17 00:00:00 2001
From: Ilia Alshanetsky <iliaa@php.net>
Date: Sun, 3 Feb 2008 16:14:16 +0000
Subject: [PATCH] Fixed bug #44028 (crash inside stream_socket_enable_crypto()
 when enabling encryption without crypto type)

---
 ext/standard/streamsfuncs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index fa908bb3e2..699c596315 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -1328,6 +1328,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