rehash.c: handle possible null pointer returned by OPENSSL_strdup
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24980)
(cherry picked from commit a5cd06f7ff
)
This commit is contained in:
parent
2b37aab596
commit
b134f1e7de
1 changed files with 5 additions and 0 deletions
|
@ -562,6 +562,11 @@ int rehash_main(int argc, char **argv)
|
|||
} else if ((env = getenv(X509_get_default_cert_dir_env())) != NULL) {
|
||||
char lsc[2] = { LIST_SEPARATOR_CHAR, '\0' };
|
||||
m = OPENSSL_strdup(env);
|
||||
if (m == NULL) {
|
||||
BIO_puts(bio_err, "out of memory\n");
|
||||
errs = 1;
|
||||
goto end;
|
||||
}
|
||||
for (e = strtok(m, lsc); e != NULL; e = strtok(NULL, lsc))
|
||||
errs += do_dir(e, h);
|
||||
OPENSSL_free(m);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue