Origin: http://pkgs.fedoraproject.org/gitweb/?p=coolkey.git;a=commit;h=36791f8443da484b1d52c0e33db7496d4a100d33
Description: Cac card crash fix, #606842.
Author: Jack Magne <jmagne@fedoraproject.org>

--- a/src/coolkey/object.cpp
+++ b/src/coolkey/object.cpp
@@ -505,6 +505,10 @@
     unsigned char tag;
     unsigned int used_length= 0;
 
+    if(!buf) {
+        return NULL;
+    }
+
     tag = buf[used_length++];
 
     /* blow out when we come to the end */
--- a/src/coolkey/slot.cpp
+++ b/src/coolkey/slot.cpp
@@ -2192,6 +2192,10 @@
 	if (throwException && (status != CKYSUCCESS)) {
 	    handleConnectionError();
 	}
+        
+        if(CKYBuffer_Size(cert) == 0) {
+            handleConnectionError();
+        }
 	return status;
     }
 
