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

ext/standard/streamsfuncs.c

index fa908bb3e27c11b573796bd5782fba727502c1ef..699c59631561bd2d5ef4d32cef59eda20a66d050 100644 (file)
@@ -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);