summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2023-08-16 16:07:10 +0200
committerTomas Mraz <tomas@openssl.org>2023-08-18 15:06:18 +0200
commit8b940b69457f0dd43496c16afaa01f510f0d8a19 (patch)
tree14d1c8022a7173983519084ac21926946730d453
parent20baa24f9f3997a96db7cd176a6ef609afe80cea (diff)
ssl_old_test.c: Check inconsistent values from SSL_get0_alpn_selected()
Fixes Coverity 1534838 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21755)
-rw-r--r--test/ssl_old_test.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ssl_old_test.c b/test/ssl_old_test.c
index 439d0ed8d0..8218ab1a90 100644
--- a/test/ssl_old_test.c
+++ b/test/ssl_old_test.c
@@ -332,6 +332,18 @@ static int verify_alpn(SSL *client, SSL *server)
OPENSSL_free(alpn_selected);
alpn_selected = NULL;
+ if (client_proto == NULL && client_proto_len != 0) {
+ BIO_printf(bio_stdout,
+ "Inconsistent SSL_get0_alpn_selected() for client!\n");
+ goto err;
+ }
+
+ if (server_proto == NULL && server_proto_len != 0) {
+ BIO_printf(bio_stdout,
+ "Inconsistent SSL_get0_alpn_selected() for server!\n");
+ goto err;
+ }
+
if (client_proto_len != server_proto_len) {
BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
goto err;