From: Dr. David von Oheimb Date: Thu, 4 Jun 2020 08:33:28 +0000 (+0200) Subject: Add OPENSSL_strdup failure check to cpt_ctrl() in bss_acpt.c X-Git-Tag: openssl-3.0.0-alpha4~99 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3f528d0899e8fe850c63d600ee29146bc8a9c125;p=oweals%2Fopenssl.git Add OPENSSL_strdup failure check to cpt_ctrl() in bss_acpt.c Reviewed-by: Bernd Edlinger Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11986) --- diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index 3523f68edd..7f1af71e0f 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -433,8 +433,10 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr) b->init = 1; } else if (num == 1) { OPENSSL_free(data->param_serv); - data->param_serv = OPENSSL_strdup(ptr); - b->init = 1; + if ((data->param_serv = OPENSSL_strdup(ptr)) == NULL) + ret = 0; + else + b->init = 1; } else if (num == 2) { data->bind_mode |= BIO_SOCK_NONBLOCK; } else if (num == 3) {