Skip to content

Commit

Permalink
trust: p11_token_load: Treat parse error as failure
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ueno committed Jan 4, 2019
1 parent eb503f3 commit 4aa6ef9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions trust/token.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4aa6ef9

Please sign in to comment.