mirror of
https://github.com/openssl/openssl.git
synced 2025-04-06 20:20:50 +08:00
apps/lib/apps.c: Add a check for OPENSSL_strdup()
Add a check for the return value of OPENSSL_strdup() to guarantee the success of allocation, similar to the other call sites. Fixes: c7d5ea2670 ("Prepare to detect index changes in OCSP responder.") Signed-off-by: JiashengJiang <jiasheng@purdue.edu> Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/27172)
This commit is contained in:
parent
60f2a71400
commit
930c645e6b
@ -1758,6 +1758,9 @@ CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
|
||||
}
|
||||
|
||||
retdb->dbfname = OPENSSL_strdup(dbfile);
|
||||
if (retdb->dbfname == NULL)
|
||||
goto err;
|
||||
|
||||
#ifndef OPENSSL_NO_POSIX_IO
|
||||
retdb->dbst = dbst;
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user