diff options
author | Daiki Ueno <dueno@redhat.com> | 2018-12-25 07:38:26 +0100 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2019-01-04 15:12:04 +0100 |
commit | 4aa6ef9e82f6bb14746a47a7d56789d5e982a1f5 (patch) | |
tree | 09860621c6bc14522905f361575b079199c5bf3c | |
parent | eb503f3a1467f21a5ecc9ae84ae23b216afc102f (diff) |
trust: p11_token_load: Treat parse error as failure
Those conditions can happen when the trust file is corrupted, so it
makes more sense to treat them as a failure instead of programmer
error.
-rw-r--r-- | trust/token.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/trust/token.c b/trust/token.c index 030c17b..b91a1d0 100644 --- a/trust/token.c +++ b/trust/token.c @@ -377,16 +377,19 @@ p11_token_load (p11_token *token) int ret; ret = loader_load_path (token, token->path, &is_dir); - return_val_if_fail (ret >= 0, -1); + if (ret < 0) + return -1; total += ret; if (is_dir) { ret = loader_load_path (token, token->anchors, &is_dir); - return_val_if_fail (ret >= 0, -1); + if (ret < 0) + return -1; total += ret; ret = loader_load_path (token, token->blacklist, &is_dir); - return_val_if_fail (ret >= 0, -1); + if (ret < 0) + return -1; total += ret; } |