]> granicus.if.org Git - p11-kit/commitdiff
p11-kit: Fix corrupted list when initialization of modules fail
authorStef Walter <stef@thewalter.net>
Wed, 25 Jun 2014 08:55:10 +0000 (10:55 +0200)
committerStef Walter <stef@thewalter.net>
Wed, 25 Jun 2014 08:58:37 +0000 (10:58 +0200)
This fixes the function call p11_kit_module_initialize() to
correctly rearrange the modules array when initializing a module
fails.

Also fixes p11_kit_modules_load_and_initialize()

p11-kit/modules.c

index b373544296854ed383c41abef69e1b290ca5aacf..2988f31430bdad6489d763c1f47f86cd3efaf224 100644 (file)
@@ -1985,6 +1985,8 @@ p11_kit_modules_initialize (CK_FUNCTION_LIST **modules,
                                failure_callback (modules[i]);
                        out--;
                        free (name);
+               } else {
+                       modules[out] = modules[i];
                }
        }