diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-06-03 21:38:20 +0200 |
---|---|---|
committer | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-06-09 12:13:14 +0200 |
commit | 46fe1c7caee1442ead1f7c780e5c50045a00f76e (patch) | |
tree | 088dc55dbab3460158d8c4b3dab9ae21ae337a4a | |
parent | 49eebbc408535e8670cb62ea661b696ec5819f15 (diff) |
Replace BUF_strdup() call by OPENSSL_strdup() adding failure check in bss_acpt.c
Add OPENSSL_strdup failure check to cpt_ctrl() in bss_acpt.c
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12036)
-rw-r--r-- | crypto/bio/bss_acpt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index 5a2cb50dfc..4461eae233 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -434,8 +434,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 = BUF_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) { |