diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2015-10-17 21:28:25 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2015-11-21 14:21:04 +0100 |
commit | 3003e0a4220f66690778b3ef7247ad5b56b4a375 (patch) | |
tree | 5ea7c0a64c76af2b3e7cd2bf73cf75e648420391 /test | |
parent | c880b3e3141ba5229d4ddf8390c4b9e09cd832f8 (diff) |
Fix (minor) problems found by ubsan
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/ssltest.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ssltest.c b/test/ssltest.c index c46c211031..1128ec83b8 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; |