]> granicus.if.org Git - p11-kit/commitdiff
trust: p11_token_load: Treat parse error as failure
authorDaiki Ueno <dueno@redhat.com>
Tue, 25 Dec 2018 06:38:26 +0000 (07:38 +0100)
committerDaiki Ueno <ueno@gnu.org>
Fri, 4 Jan 2019 14:12:04 +0000 (15:12 +0100)
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.

trust/token.c

index 030c17b8c61122c005e6ab3ab6a2c9c07686b2d4..b91a1d015ca084bd9b24fc9475a2528a2d2ff9a9 100644 (file)
@@ -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;
        }