summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2012-04-01 21:56:35 +0200
committerStef Walter <stefw@gnome.org>2012-04-01 21:56:35 +0200
commitff9926b8dcead91e7fc6d08d0ca1d2d8cc982308 (patch)
tree996dcc5b785b5c43f7cab4a1fcd5dd507ebfc61f
parenta899d9be0cab72dcfe00f100527c52ea598fed70 (diff)
downloadp11-kit-ff9926b8dcead91e7fc6d08d0ca1d2d8cc982308.tar.gz
Fix crasher when a duplicate module is present
-rw-r--r--p11-kit/modules.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/p11-kit/modules.c b/p11-kit/modules.c
index f059097..569a735 100644
--- a/p11-kit/modules.c
+++ b/p11-kit/modules.c
@@ -440,6 +440,13 @@ take_config_and_load_module_unlocked (char **name, hashmap **config)
return rv;
}
+ /*
+ * We support setting of CK_C_INITIALIZE_ARGS.pReserved from
+ * 'x-init-reserved' setting in the config. This only works with specific
+ * PKCS#11 modules, and is non-standard use of that field.
+ */
+ mod->init_args.pReserved = _p11_hash_get (mod->config, "x-init-reserved");
+
prev = _p11_hash_get (gl.modules, mod->funcs);
/* If same module was loaded previously, just take over config */
@@ -463,12 +470,6 @@ take_config_and_load_module_unlocked (char **name, hashmap **config)
}
}
- /*
- * We support setting of CK_C_INITIALIZE_ARGS.pReserved from
- * 'x-init-reserved' setting in the config. This only works with specific
- * PKCS#11 modules, and is non-standard use of that field.
- */
- mod->init_args.pReserved = _p11_hash_get (mod->config, "x-init-reserved");
return CKR_OK;
}