summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ.C. Jones <jjones@mozilla.com>2019-11-27 19:43:37 +0000
committerJ.C. Jones <jjones@mozilla.com>2019-11-27 19:43:37 +0000
commitd35c52a97df30a6156bafd3abe4c23141601b612 (patch)
tree0fe7e18cf9d3360df43e93d1a5c92a646a8a914f
parent0cbee2df1f73cfa3bf5e7ef4d7b16e13c33f0df8 (diff)
downloadnss-hg-d35c52a97df30a6156bafd3abe4c23141601b612.tar.gz
Bug 1597799 - Guard against null ptrs in NSSCKFWObject r=kjacobs
There's a bunch of similar code that could use guards in here, but I wanted to be minimal for this patch. Differential Revision: https://phabricator.services.mozilla.com/D54805
-rw-r--r--lib/ckfw/object.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/ckfw/object.c b/lib/ckfw/object.c
index ff0542ee4..9f6b4cee0 100644
--- a/lib/ckfw/object.c
+++ b/lib/ckfw/object.c
@@ -493,18 +493,11 @@ nssCKFWObject_GetAttributeSize(
{
CK_ULONG rv;
-#ifdef NSSDEBUG
if (!pError) {
return (CK_ULONG)0;
}
- *pError = nssCKFWObject_verifyPointer(fwObject);
- if (CKR_OK != *pError) {
- return (CK_ULONG)0;
- }
-#endif /* NSSDEBUG */
-
- if (!fwObject->mdObject->GetAttributeSize) {
+ if (!fwObject || !fwObject->mdObject || !fwObject->mdObject->GetAttributeSize) {
*pError = CKR_GENERAL_ERROR;
return (CK_ULONG)0;
}