]> granicus.if.org Git - php/commitdiff
make sure the stream context is present before looking for any options
authorAntony Dovgal <tony2001@php.net>
Sat, 4 Dec 2010 21:54:20 +0000 (21:54 +0000)
committerAntony Dovgal <tony2001@php.net>
Sat, 4 Dec 2010 21:54:20 +0000 (21:54 +0000)
and fix segfault

ext/openssl/xp_ssl.c

index 93ccf2826c5ece8ba49f58ad06aeb222c7e1ec8a..93658876c9dbb6fd1eb2329f1f9e0ce7dbb528c9 100644 (file)
@@ -373,7 +373,7 @@ static inline int php_openssl_setup_crypto(php_stream *stream,
        {
                zval **val;
 
-               if (SUCCESS == php_stream_context_get_option(
+               if (stream->context && SUCCESS == php_stream_context_get_option(
                                        stream->context, "ssl", "no_ticket", &val) && 
                                zval_is_true(*val)) {
                        SSL_CTX_set_options(sslsock->ctx, SSL_OP_NO_TICKET);