Welcome! Log In Create A New Profile

Advanced

Re: avoid crash in case of plain http

May 11, 2011 06:10AM
On Mon, May 09, 2011 at 04:42:29PM +0800, Robert wrote:
> diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
> index 0527c9c..822d7ba 100644
> --- a/src/event/ngx_event_openssl.c
> +++ b/src/event/ngx_event_openssl.c
> @@ -2198,8 +2198,7 @@ ngx_ssl_get_serial_number(ngx_connection_t *c,
> ngx_pool_t *pool, ngx_str_t *s)
>
> s->len = 0;
>
> - cert = SSL_get_peer_certificate(c->ssl->connection);
> - if (cert == NULL) {
> + if ( NULL == c->ssl || NULL == ( cert =
> SSL_get_peer_certificate(c->ssl->connection))) {
> return NGX_OK;
> }

ngx_ssl_get_serial_number() is called only by ngx_http_ssl_variable()
which tests c->ssl existence.


--
Igor Sysoev

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

avoid crash in case of plain http

Robert 1587 May 11, 2011 06:06AM

Re: avoid crash in case of plain http

Igor Sysoev 774 May 11, 2011 06:10AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 103
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready