- 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:
okir 2003-04-16 15:53:44 +00:00
parent f81929eb16
commit 095db2b907
1 changed files with 1 additions and 1 deletions

View File

@ -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); \
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"); \
rv = p11->C_GetAttributeValue(sess, obj, &attr, 1); \
} \