diff options
author | x2018 <xkernel.wang@foxmail.com> | 2021-11-23 21:33:17 +0800 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-11-25 12:03:40 +1000 |
commit | dd0c0eb7a54aed1d0b8b71ad22253558dc26d646 (patch) | |
tree | fde806090f14eb8c15ec7993390465b7efbacfea /apps/lib/app_rand.c | |
parent | ea4d670a094a2b5daa13ad13db247653a224a17d (diff) |
check the return value of OPENSSL_strdup(CRYPTO_strdup) to prevent potential memory access error
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17113)
(cherry picked from commit b9648f31a4917b8594caebda3e6d8d313514fe24)
Diffstat (limited to 'apps/lib/app_rand.c')
-rw-r--r-- | apps/lib/app_rand.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/lib/app_rand.c b/apps/lib/app_rand.c index e38d3a72fc..08550d7bfc 100644 --- a/apps/lib/app_rand.c +++ b/apps/lib/app_rand.c @@ -110,6 +110,8 @@ int opt_rand(int opt) case OPT_R_WRITERAND: OPENSSL_free(save_rand_file); save_rand_file = OPENSSL_strdup(opt_arg()); + if (save_rand_file == NULL) + return 0; break; } return 1; |