]> granicus.if.org Git - p11-kit/commitdiff
trust: Fix unlikely use of uninitialized memory in token loading
authorStef Walter <stef@thewalter.net>
Fri, 8 Aug 2014 15:20:30 +0000 (17:20 +0200)
committerStef Walter <stef@thewalter.net>
Fri, 8 Aug 2014 16:44:20 +0000 (18:44 +0200)
trust/token.c

index 15ca0187ace370ef2a12cbc41592e39efb51ac81..1ed26eb6922cdebe2bc1258b0a35cfeafe159a5a 100644 (file)
@@ -301,10 +301,10 @@ loader_load_path (p11_token *token,
                if (errno != ENOENT)
                        p11_message_err (errno, "cannot access trust certificate path: %s", path);
                loader_gone_file (token, path);
-               return 0;
-       }
+               *is_dir = false;
+               ret = 0;
 
-       if (S_ISDIR (sb.st_mode)) {
+       } else if (S_ISDIR (sb.st_mode)) {
                *is_dir = true;
                ret = 0;