diff options
Diffstat (limited to 'common/attrs.c')
-rw-r--r-- | common/attrs.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/common/attrs.c b/common/attrs.c index 9f3e522..4a3d655 100644 --- a/common/attrs.c +++ b/common/attrs.c @@ -508,12 +508,14 @@ unsigned int p11_attr_hash (const void *data) { const CK_ATTRIBUTE *attr = data; - uint32_t hash; + uint32_t hash = 0; - p11_hash_murmur3 (&hash, - &attr->type, sizeof (attr->type), - attr->pValue, (size_t)attr->ulValueLen, - NULL); + if (attr != NULL) { + p11_hash_murmur3 (&hash, + &attr->type, sizeof (attr->type), + attr->pValue, (size_t)attr->ulValueLen, + NULL); + } return hash; } |