From: Pauli Date: Mon, 22 Mar 2021 02:31:43 +0000 (+1000) Subject: test: fix coverity 1451574: improper use of negative value X-Git-Tag: openssl-3.0.0-alpha14~161 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ba18520ffaa8109eb63b46ac350c85302d9d05d;p=thirdparty%2Fopenssl.git test: fix coverity 1451574: improper use of negative value Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14638) --- diff --git a/test/sslapitest.c b/test/sslapitest.c index edaadb170f4..3e5d532bf4f 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 */