projects
/
p11-kit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f78cb0
)
proxy: Fix null dereference when reusing slots
author
Daiki Ueno
<dueno@redhat.com>
Tue, 16 Oct 2018 16:18:05 +0000
(18:18 +0200)
committer
Daiki Ueno
<ueno@gnu.org>
Wed, 17 Oct 2018 08:13:32 +0000
(10:13 +0200)
p11-kit/proxy.c
patch
|
blob
|
history
diff --git
a/p11-kit/proxy.c
b/p11-kit/proxy.c
index 11e6165f5f6e27b832f461091a1e1bb63a87f3bf..8eaf205ffb94a5e1a0393e122d5cc292374c1a2f 100644
(file)
--- a/
p11-kit/proxy.c
+++ b/
p11-kit/proxy.c
@@
-307,7
+307,10
@@
proxy_create (Proxy **res, CK_FUNCTION_LIST **loaded,
break;
}
py->mappings[py->n_mappings].funcs = funcs;
- py->mappings[py->n_mappings].wrap_slot = j == n_mappings ? py->n_mappings + MAPPING_OFFSET : mappings[j].wrap_slot;
+ py->mappings[py->n_mappings].wrap_slot =
+ (n_mappings == 0 || j == n_mappings) ?
+ py->n_mappings + MAPPING_OFFSET :
+ mappings[j].wrap_slot;
py->mappings[py->n_mappings].real_slot = slots[i];
++py->n_mappings;
}