[pkg-opensc-commit] [libp11] 166/239: Fix warning of sign mismatch, but probably there is a bug here

Eric Dorland eric at moszumanska.debian.org
Sat Oct 17 06:21:27 UTC 2015


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository libp11.

commit 95ccb5a4b4b6437cc217263687f069ecdf17bc6d
Author: Alon Bar-Lev <alon.barlev at gmail.com>
Date:   Wed Dec 14 11:01:00 2011 +0000

    Fix warning of sign mismatch, but probably there is a bug here
---
 src/p11_attr.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/p11_attr.c b/src/p11_attr.c
index ce64cda..98d29c0 100644
--- a/src/p11_attr.c
+++ b/src/p11_attr.c
@@ -89,7 +89,11 @@ pkcs11_getattr_bn(PKCS11_TOKEN * token, CK_OBJECT_HANDLE object,
 
 	if (pkcs11_getattr_var(token, object, type, binary, &size))
 		return -1;
-	if (size == -1) {
+	/*
+	 * @ALON: invalid object,
+	 * not sure it will survice the ulValueLen->size_t and keep sign at all platforms
+	 */
+	if (size == (size_t)-1) {
 		PKCS11err(PKCS11_F_PKCS11_GETATTR,
 			  pkcs11_map_err(CKR_ATTRIBUTE_TYPE_INVALID));
 		return -1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/libp11.git



More information about the pkg-opensc-commit mailing list