diff options
author | Stef Walter <stefw@gnome.org> | 2012-04-01 21:56:35 +0200 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2012-04-01 21:56:35 +0200 |
commit | ff9926b8dcead91e7fc6d08d0ca1d2d8cc982308 (patch) | |
tree | 996dcc5b785b5c43f7cab4a1fcd5dd507ebfc61f /p11-kit | |
parent | a899d9be0cab72dcfe00f100527c52ea598fed70 (diff) |
Fix crasher when a duplicate module is present
Diffstat (limited to 'p11-kit')
-rw-r--r-- | p11-kit/modules.c | 13 |
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; } |