]> granicus.if.org Git - p11-kit/commitdiff
modules: Fix index used in call to p11_dict_remove()
authorSimon Haggett <simon.haggett@gmail.com>
Tue, 12 Mar 2019 11:26:20 +0000 (11:26 +0000)
committerDaiki Ueno <ueno@gnu.org>
Wed, 13 Mar 2019 11:41:08 +0000 (12:41 +0100)
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 <simon.haggett@gmail.com>
p11-kit/modules.c

index 891ce4c5270f7a17df9626422a592e9f78b4fa7d..39e1fdacae268a2193907e2bde3d1058aace9dc7 100644 (file)
@@ -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 ();
                }
        }