]> git.saurik.com Git - apple/security.git/blobdiff - libsecurity_cdsa_utilities/lib/cssmpods.cpp
Security-55471.14.4.tar.gz
[apple/security.git] / libsecurity_cdsa_utilities / lib / cssmpods.cpp
index 60e5ddd08b01603b305b85085f4e31e7f4c4f45e..d17dba4114e777730d8a555864f87b0e48cc45a8 100644 (file)
@@ -133,6 +133,12 @@ CssmSubserviceUid::CssmSubserviceUid(const CSSM_GUID &guid,
 
 bool CssmSubserviceUid::operator == (const CSSM_SUBSERVICE_UID &otherUid) const
 {
 
 bool CssmSubserviceUid::operator == (const CSSM_SUBSERVICE_UID &otherUid) const
 {
+    // make sure we don't crash if we get bad data
+    if (&otherUid == 0x0)
+    {
+        return false;
+    }
+    
        const CssmSubserviceUid &other = CssmSubserviceUid::overlay(otherUid);
        return subserviceId() == other.subserviceId()
                && subserviceType() == other.subserviceType()
        const CssmSubserviceUid &other = CssmSubserviceUid::overlay(otherUid);
        return subserviceId() == other.subserviceId()
                && subserviceType() == other.subserviceType()
@@ -141,6 +147,11 @@ bool CssmSubserviceUid::operator == (const CSSM_SUBSERVICE_UID &otherUid) const
 
 bool CssmSubserviceUid::operator < (const CSSM_SUBSERVICE_UID &otherUid) const
 {
 
 bool CssmSubserviceUid::operator < (const CSSM_SUBSERVICE_UID &otherUid) const
 {
+    if (&otherUid == 0x0)
+    {
+        return false;
+    }
+    
        const CssmSubserviceUid &other = CssmSubserviceUid::overlay(otherUid);
        if (subserviceId() < other.subserviceId())
                return true;
        const CssmSubserviceUid &other = CssmSubserviceUid::overlay(otherUid);
        if (subserviceId() < other.subserviceId())
                return true;