From 6abc26163488322d2601245427d8e01934d726de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E4=B8=80=E9=B8=A3?= Date: Tue, 18 Sep 2018 10:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dssl=5Fchello=5Fparse=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AD=98=E6=B7=B7=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/src/ssl_utils.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/src/ssl_utils.cc b/platform/src/ssl_utils.cc index 0e2c306..dd25a79 100644 --- a/platform/src/ssl_utils.cc +++ b/platform/src/ssl_utils.cc @@ -1910,7 +1910,10 @@ static char* parse_cipher_suites(struct cipher_suite* _cipher_suite_list, int n, pos += 2; } int len = strnlen(cipher_suites_str, TFE_STRING_MAX); - cipher_suites_str[len-1] = '\0'; + if(len > 0) + { + cipher_suites_str[len-1] = '\0'; + } if(pos != buff_len) { *result = CHELLO_PARSE_INVALID_FORMAT;