summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiasheng Jiang <jiasheng@iscas.ac.cn>2022-06-14 15:06:23 +0800
committerTodd Short <todd.short@me.com>2022-06-15 11:17:34 -0400
commitf5beeb29a0a46757a2f0724048a2ece67034874e (patch)
treec78dd32f16b818323f2dfb0977526aabef27a6cf
parent8358ad79d6ce7689ef6adf7ecb651e67a11f9b1a (diff)
test/ssl_old_test.c: Add check for OPENSSL_zalloc
As the potential failure of the OPENSSL_zalloc(), it should be better to add the check and return error if fails. Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Yang <kaishen.yy@antfin.com> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/18552) (cherry picked from commit 4f4942a133bd57c4940fb1bc6ed7c8b67da4d8f0)
-rw-r--r--test/ssl_old_test.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ssl_old_test.c b/test/ssl_old_test.c
index 94f0aa7c67..bbe95d70f9 100644
--- a/test/ssl_old_test.c
+++ b/test/ssl_old_test.c
@@ -1741,6 +1741,8 @@ int main(int argc, char *argv[])
/* Use a fixed key so that we can decrypt the ticket. */
size = SSL_CTX_set_tlsext_ticket_keys(s_ctx, NULL, 0);
keys = OPENSSL_zalloc(size);
+ if (keys == NULL)
+ goto end;
SSL_CTX_set_tlsext_ticket_keys(s_ctx, keys, size);
OPENSSL_free(keys);
}