From 793cc3b78f17bb5a3c151eba1144b73a5d51be3e Mon Sep 17 00:00:00 2001 From: Simon Haggett Date: Tue, 12 Mar 2019 11:26:20 +0000 Subject: modules: Fix index used in call to p11_dict_remove() This fixes a call to p11_dict_remove() in managed_steal_sessions_inlock() to use the correct index in the stolen array (i, rather than at). This avoids an assert, which was encountered on a host serving a PKCS#11 module to a remote Linux client. Signed-off-by: Simon Haggett --- p11-kit/modules.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p11-kit') diff --git a/p11-kit/modules.c b/p11-kit/modules.c index 891ce4c..39e1fda 100644 --- a/p11-kit/modules.c +++ b/p11-kit/modules.c @@ -1647,7 +1647,7 @@ managed_steal_sessions_inlock (p11_dict *sessions, /* Only removed some, go through and remove those */ } else { for (i = 0; i < at; i++) { - if (!p11_dict_remove (sessions, stolen + at)) + if (!p11_dict_remove (sessions, stolen + i)) assert_not_reached (); } } -- cgit v1.1