From 48018375d2283b11ea428f50fc77b68d465c1249 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Wed, 3 Apr 2024 14:46:41 +0800 Subject: OMPUB-1210: Enhance stability --- src/SSL_Message.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/SSL_Message.c') diff --git a/src/SSL_Message.c b/src/SSL_Message.c index 284c0a7..5e335fa 100644 --- a/src/SSL_Message.c +++ b/src/SSL_Message.c @@ -483,7 +483,7 @@ int ssl_parse_client_hello(struct ssl_client_hello *chello, unsigned char *paylo UT_string *cipher_suite_string; utstring_new(cipher_suite_string); utstring_printf(cipher_suite_string, ","); - if(chello->ciphersuites.len>0) + if(chello->ciphersuites.len>0 && chello->ciphersuites.value!=NULL) { for(unsigned short i=0; iciphersuites.len; i+=2) { @@ -502,10 +502,10 @@ int ssl_parse_client_hello(struct ssl_client_hello *chello, unsigned char *paylo UT_string *ec_string; utstring_new(ec_string); utstring_printf(ec_string, ","); - if(ec!=NULL) + if(ec!=NULL && ec->value!=NULL && ec->len>0) { unsigned short length=BtoL2BytesNum((const char*)(ec->value)); - for(unsigned short j=0; jlen); j+=2) { unsigned short group=BtoL2BytesNum((const char*)(ec->value+j+2)); if(ssl_is_grease_value(group)==0) @@ -519,10 +519,10 @@ int ssl_parse_client_hello(struct ssl_client_hello *chello, unsigned char *paylo UT_string *ec_point_format_string; utstring_new(ec_point_format_string); utstring_printf(ec_point_format_string, ","); - if(ec_point_format!=NULL) + if(ec_point_format!=NULL && ec_point_format->value!=NULL && ec_point_format->len>0) { char length=BtoL1BytesNum((const char*)(ec_point_format->value)); - for(char j=0; jlen); j++) { utstring_printf(ec_point_format_string, "%u-", ec_point_format->value[j+1]); } -- cgit v1.2.3