diff options
author | Viktor Dukhovni <openssl-users@dukhovni.org> | 2018-04-19 01:52:26 +0200 |
---|---|---|
committer | Viktor Dukhovni <openssl-users@dukhovni.org> | 2018-04-19 04:29:35 +0200 |
commit | a4107d73d597a6f8754f7cf5c8c53d2097bea652 (patch) | |
tree | 79b867ef178dd0e835a34520ee2d51f5b7dda96c /apps/ocsp.c | |
parent | Clarify the configuration module in config.pod (diff) | |
download | openssl-a4107d73d597a6f8754f7cf5c8c53d2097bea652.tar.xz openssl-a4107d73d597a6f8754f7cf5c8c53d2097bea652.zip |
Add missing index_index() when reloading OCSP responder
Also, future-proof index_index() return codes by requiring success
to return a positive value.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'apps/ocsp.c')
-rw-r--r-- | apps/ocsp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/ocsp.c b/apps/ocsp.c index 3c5534af0e..83461c7cb5 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -559,7 +559,7 @@ int ocsp_main(int argc, char **argv) if (ridx_filename != NULL) { rdb = load_index(ridx_filename, NULL); - if (rdb == NULL || !index_index(rdb)) { + if (rdb == NULL || index_index(rdb) <= 0) { ret = 1; goto end; } @@ -582,10 +582,11 @@ redo_accept: if (index_changed(rdb)) { CA_DB *newrdb = load_index(ridx_filename, NULL); - if (newrdb != NULL) { + if (newrdb != NULL && index_index(newrdb) > 0) { free_index(rdb); rdb = newrdb; } else { + free_index(newrdb); log_message(LOG_ERR, "error reloading updated index: %s", ridx_filename); } |