From: Wez Furlong Date: Mon, 5 May 2003 16:30:04 +0000 (+0000) Subject: Avoid potential segfault when preparing an SSL stream. X-Git-Tag: php-4.3.2RC3~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=246300a60cd0c614fc115e59a583a34af4300408;p=php Avoid potential segfault when preparing an SSL stream. --- diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 4f6011d4fa..719c5d637d 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2967,7 +2967,7 @@ PHP_FUNCTION(openssl_open) /* SSL verification functions */ -#define GET_VER_OPT(name) SUCCESS == php_stream_context_get_option(stream->context, "ssl", name, &val) +#define GET_VER_OPT(name) (stream->context && SUCCESS == php_stream_context_get_option(stream->context, "ssl", name, &val)) #define GET_VER_OPT_STRING(name, str) if (GET_VER_OPT(name)) { convert_to_string_ex(val); str = Z_STRVAL_PP(val); } static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx)