]> 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:14:44 +0000 (16:14 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 3 Feb 2008 16:14:44 +0000 (16:14 +0000)
enabling encryption without crypto type)

ext/standard/streamsfuncs.c

index 4ad46d4ff98e88fbd8197e62fbc4366656ca16ac..98671a8501e7b48468cf5b4fb7e642002c3ef11a 100644 (file)
@@ -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);