[nginx] SSL: added explicit check for ngx_strlchr() result.

Maxim Dounin mdounin at mdounin.ru
Tue Apr 22 12:11:57 UTC 2014


details:   http://hg.nginx.org/nginx/rev/a77c0839c993
branches:  
changeset: 5666:a77c0839c993
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Tue Apr 22 14:02:45 2014 +0400
description:
SSL: added explicit check for ngx_strlchr() result.

diffstat:

 src/event/ngx_event_openssl.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
--- 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
 
         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) {



More information about the nginx-devel mailing list