diff options
author | Richard Levitte <levitte@openssl.org> | 2017-07-01 18:25:43 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2017-07-03 07:47:13 +0200 |
commit | 6e2f49b38429d9df00ed12ade60e3de3b9ba43b3 (patch) | |
tree | 32589f4bb1776f106c3593072dd301570987b9a9 /crypto/store | |
parent | Fix copyright date for the ARIA evp file. (diff) | |
download | openssl-6e2f49b38429d9df00ed12ade60e3de3b9ba43b3.tar.xz openssl-6e2f49b38429d9df00ed12ade60e3de3b9ba43b3.zip |
Make sure OSSL_STORE_load() isn't caught in an endless loop
The post process callback might potentially say "no" to everything (by
constantly returning NULL) and thereby cause an endless loop. Ensure
that we stop all processing when "eof" is reached.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/3823)
Diffstat (limited to 'crypto/store')
-rw-r--r-- | crypto/store/store_lib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/store/store_lib.c b/crypto/store/store_lib.c index d5bb8b88ce..91faae20c5 100644 --- a/crypto/store/store_lib.c +++ b/crypto/store/store_lib.c @@ -90,6 +90,9 @@ OSSL_STORE_INFO *OSSL_STORE_load(OSSL_STORE_CTX *ctx) OSSL_STORE_INFO *v = NULL; again: + if (OSSL_STORE_eof(ctx)) + return NULL; + v = ctx->loader->load(ctx->loader_ctx, ctx->ui_method, ctx->ui_data); if (ctx->post_process != NULL && v != NULL) { |