- getting CKA_LABEL would not 0-terminate the string
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1025 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
f81929eb16
commit
095db2b907
|
@ -750,7 +750,7 @@ get##ATTR(CK_SESSION_HANDLE sess, CK_OBJECT_HANDLE obj, CK_ULONG_PTR pulCount) \
|
||||||
\
|
\
|
||||||
rv = p11->C_GetAttributeValue(sess, obj, &attr, 1); \
|
rv = p11->C_GetAttributeValue(sess, obj, &attr, 1); \
|
||||||
if (rv == CKR_OK) { \
|
if (rv == CKR_OK) { \
|
||||||
if (!(attr.pValue = malloc(attr.ulValueLen))) \
|
if (!(attr.pValue = calloc(1, attr.ulValueLen + 1))) \
|
||||||
fatal("out of memory in get" #ATTR ": %m"); \
|
fatal("out of memory in get" #ATTR ": %m"); \
|
||||||
rv = p11->C_GetAttributeValue(sess, obj, &attr, 1); \
|
rv = p11->C_GetAttributeValue(sess, obj, &attr, 1); \
|
||||||
} \
|
} \
|
||||||
|
|
Loading…
Reference in New Issue