Fix all clang scan-build warnings

This commit is contained in:
Trevor Bentley
2017-09-27 11:28:39 +02:00
parent 90209997cc
commit 9a7ccf48fa
7 changed files with 18 additions and 10 deletions
+6
View File
@@ -215,6 +215,11 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetSlotList)(
return CKR_OK;
}
if (!pulCount) {
DOUT;
return CKR_ARGUMENTS_BAD;
}
if ((tokenPresent && *pulCount < n_slots_with_token) || (!tokenPresent && *pulCount < n_slots)) {
DBG("Buffer too small: needed %lu, provided %lu", n_slots, *pulCount);
return CKR_BUFFER_TOO_SMALL;
@@ -1214,6 +1219,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DestroyObject)(
rv = delete_cert(cert_id);
if (rv != CKR_OK) {
free(obj_ptr);
DBG("Unable to delete certificate data");
return CKR_FUNCTION_FAILED;
}