aboutsummaryrefslogtreecommitdiff
path: root/test/ssltest.c
diff options
context:
space:
mode:
authorAlessandro Ghedini <alessandro@ghedini.me>2015-10-17 21:28:25 +0200
committerAndy Polyakov <appro@openssl.org>2015-11-21 14:21:04 +0100
commit3003e0a4220f66690778b3ef7247ad5b56b4a375 (patch)
tree5ea7c0a64c76af2b3e7cd2bf73cf75e648420391 /test/ssltest.c
parentc880b3e3141ba5229d4ddf8390c4b9e09cd832f8 (diff)
downloadopenssl-3003e0a4220f66690778b3ef7247ad5b56b4a375.zip
openssl-3003e0a4220f66690778b3ef7247ad5b56b4a375.tar.gz
openssl-3003e0a4220f66690778b3ef7247ad5b56b4a375.tar.bz2
Fix (minor) problems found by ubsan
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test/ssltest.c')
-rw-r--r--test/ssltest.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ssltest.c b/test/ssltest.c
index c46c211..1128ec8 100644
--- a/test/ssltest.c
+++ b/test/ssltest.c
@@ -454,7 +454,12 @@ static int verify_alpn(SSL *client, SSL *server)
OPENSSL_free(alpn_selected);
alpn_selected = NULL;
- if (client_proto_len != server_proto_len ||
+ if (client_proto_len != server_proto_len) {
+ BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
+ goto err;
+ }
+
+ if (client_proto != NULL &&
memcmp(client_proto, server_proto, client_proto_len) != 0) {
BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
goto err;