summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-03-22 12:31:43 +1000
committerPauli <ppzgs1@gmail.com>2021-03-24 09:12:43 +1000
commit9ba18520ffaa8109eb63b46ac350c85302d9d05d (patch)
treeff1d8c80e0d20fb3930520cd1bccc727ea24d99c
parent1634b2df9f12d3976129ba49e38638e3ab368e3d (diff)
test: fix coverity 1451574: improper use of negative value
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14638)
-rw-r--r--test/sslapitest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/sslapitest.c b/test/sslapitest.c
index edaadb170f..3e5d532bf4 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -5960,7 +5960,8 @@ static int get_MFL_from_client_hello(BIO *bio, int *mfl_codemfl_code)
memset(&pkt2, 0, sizeof(pkt2));
memset(&pkt3, 0, sizeof(pkt3));
- if (!TEST_true( PACKET_buf_init( &pkt, data, len ) )
+ if (!TEST_long_gt(len, 0)
+ || !TEST_true( PACKET_buf_init( &pkt, data, len ) )
/* Skip the record header */
|| !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
/* Skip the handshake message header */