projects
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69fb52e
)
test: fix coverity 1451534: improper use of negative value
author
Pauli
<ppzgs1@gmail.com>
Mon, 22 Mar 2021 02:46:12 +0000
(12:46 +1000)
committer
Pauli
<ppzgs1@gmail.com>
Tue, 23 Mar 2021 23:12:43 +0000
(09:12 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14638)
test/servername_test.c
patch
|
blob
|
history
diff --git
a/test/servername_test.c
b/test/servername_test.c
index ddf0417bc642cb1ab651bf7647abc4fd370a0390..b417f8bcacbad6abaa55d7330d3a560b4f3bfaf7 100644
(file)
--- a/
test/servername_test.c
+++ b/
test/servername_test.c
@@
-52,8
+52,8
@@
static int get_sni_from_client_hello(BIO *bio, char **sni)
memset(&pkt4, 0, sizeof(pkt4));
memset(&pkt5, 0, sizeof(pkt5));
- len = BIO_get_mem_data(bio, (char **)&data);
-
if (
!TEST_true(PACKET_buf_init(&pkt, data, len))
+ if (!TEST_long_ge(len = BIO_get_mem_data(bio, (char **)&data), 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 */