From ab27346ceb5d4e856671a033ac1f6521c86514a1 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Tue, 10 Jul 2018 16:57:07 +0200 Subject: proxy: Fail early if there is no slot mappings --- p11-kit/proxy.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'p11-kit/proxy.c') diff --git a/p11-kit/proxy.c b/p11-kit/proxy.c index 916ee92..31b9bb2 100644 --- a/p11-kit/proxy.c +++ b/p11-kit/proxy.c @@ -123,6 +123,8 @@ map_slot_unlocked (Proxy *px, if (slot > px->n_mappings) { return CKR_SLOT_ID_INVALID; + } else if (px->n_mappings == 0) { + return CKR_SLOT_ID_INVALID; } else { assert (px->mappings); memcpy (mapping, &px->mappings[slot], sizeof (Mapping)); -- cgit v1.1