From 0fd4f76e68a28cac43574c232b3e3a52418bd446 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Tue, 22 Apr 2014 14:02:45 +0400 Subject: [PATCH] SSL: added explicit check for ngx_strlchr() result. --- src/event/ngx_event_openssl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c index 1d2d1efd9..f885a5c7f 100644 --- a/src/event/ngx_event_openssl.c +++ b/src/event/ngx_event_openssl.c @@ -2637,6 +2637,11 @@ ngx_ssl_check_name(ngx_str_t *name, ASN1_STRING *pattern) end = s + slen; s = ngx_strlchr(s, end, '.'); + + if (s == NULL) { + return NGX_ERROR; + } + slen = end - s; if (plen == slen && ngx_strncasecmp(s, p, plen) == 0) {