summaryrefslogtreecommitdiff
path: root/p11-kit/proxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'p11-kit/proxy.c')
-rw-r--r--p11-kit/proxy.c2
1 files changed, 2 insertions, 0 deletions
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));