summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorliuxueli <[email protected]>2024-04-03 14:46:41 +0800
committerliuxueli <[email protected]>2024-04-03 14:46:41 +0800
commit48018375d2283b11ea428f50fc77b68d465c1249 (patch)
tree58f4ca91b845538b9ee67ad3311b31e62dd869eb /src
parent00218891bdf3833d5f3cd741fa736fe52329b119 (diff)
OMPUB-1210: Enhance stabilityv3.1.1
Diffstat (limited to 'src')
-rw-r--r--src/SSL_Message.c10
1 files changed, 5 insertions, 5 deletions
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; i<chello->ciphersuites.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; j<length; j+=2)
+ for(unsigned short j=0; (j<length) && (length < ec->len); 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; j<length; j++)
+ for(char j=0; j<length && (length < ec_point_format->len); j++)
{
utstring_printf(ec_point_format_string, "%u-", ec_point_format->value[j+1]);
}