diff options
Diffstat (limited to 'p11-kit')
-rw-r--r-- | p11-kit/proxy.c | 3 | ||||
-rw-r--r-- | p11-kit/rpc-server.c | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/p11-kit/proxy.c b/p11-kit/proxy.c index abe7935..11e6165 100644 --- a/p11-kit/proxy.c +++ b/p11-kit/proxy.c @@ -612,7 +612,8 @@ proxy_C_OpenSession (CK_X_FUNCTION_LIST *self, sess->wrap_slot = map.wrap_slot; sess->real_session = *handle; sess->wrap_session = ++state->last_handle; /* TODO: Handle wrapping, and then collisions */ - p11_dict_set (state->px->sessions, &sess->wrap_session, sess); + if (!p11_dict_set (state->px->sessions, &sess->wrap_session, sess)) + warn_if_reached (); *handle = sess->wrap_session; } diff --git a/p11-kit/rpc-server.c b/p11-kit/rpc-server.c index 2db3524..3a8991d 100644 --- a/p11-kit/rpc-server.c +++ b/p11-kit/rpc-server.c @@ -2226,7 +2226,11 @@ p11_kit_remote_serve_tokens (const char **tokens, p11_message_err (error, "couldn't subclass filter"); goto out; } - p11_dict_set (filters, module, filter); + if (!p11_dict_set (filters, module, filter)) { + error = EINVAL; + p11_message_err (error, "couldn't register filter"); + goto out; + } } for (i = 0; i < n_tokens; i++) { |