X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b54c578e17e9bcbd74aa30ea75e25e955b9a6205..refs/heads/master:/OSX/libsecurity_keychain/lib/Item.cpp diff --git a/OSX/libsecurity_keychain/lib/Item.cpp b/OSX/libsecurity_keychain/lib/Item.cpp index 474aba73..f6720512 100644 --- a/OSX/libsecurity_keychain/lib/Item.cpp +++ b/OSX/libsecurity_keychain/lib/Item.cpp @@ -331,7 +331,7 @@ DbAttributes* ItemImpl::getCurrentAttributes() { void ItemImpl::encodeAttributes(CssmOwnedData &attributeBlob) { // Sometimes we don't have our attributes. Find them. - auto_ptr dbAttributes(getCurrentAttributes()); + unique_ptr dbAttributes(getCurrentAttributes()); encodeAttributesFromDictionary(attributeBlob, dbAttributes.get()); } @@ -456,7 +456,7 @@ void ItemImpl::encodeAttributesFromDictionary(CssmOwnedData &attributeBlob, DbAt } void ItemImpl::computeDigest(CssmOwnedData &sha2) { - auto_ptr dbAttributes(getCurrentAttributes()); + unique_ptr dbAttributes(getCurrentAttributes()); ItemImpl::computeDigestFromDictionary(sha2, dbAttributes.get()); } @@ -593,7 +593,7 @@ bool ItemImpl::checkIntegrity(AclBearer& aclBearer) { return true; } - auto_ptr dbAttributes(getCurrentAttributes()); + unique_ptr dbAttributes(getCurrentAttributes()); return checkIntegrityFromDictionary(aclBearer, dbAttributes.get()); } @@ -607,7 +607,7 @@ bool ItemImpl::checkIntegrityFromDictionary(AclBearer& aclBearer, DbAttributes* // them. AclEntryInfo &info = aclInfos.at(0); - auto_ptr acl(new ACL(info, Allocator::standard())); + unique_ptr acl(new ACL(info, Allocator::standard())); for(int i = 1; i < aclInfos.count(); i++) { secnotice("integrity", "*** DUPLICATE INTEGRITY ACL, something has gone wrong"); @@ -1073,7 +1073,7 @@ ItemImpl::doChange(Keychain keychain, CSSM_DB_RECORDTYPE recordType, void (^tryC } catch (CssmError cssme) { // If there's a "duplicate" of this item, it might be an item with corrupt/invalid attributes // Try to extract the item and check its attributes, then try again if necessary - auto_ptr primaryKeyAttrs; + unique_ptr primaryKeyAttrs; if(cssme.error == CSSMERR_DL_INVALID_UNIQUE_INDEX_DATA) { secnotice("integrity", "possible duplicate, trying to delete invalid items"); @@ -1113,7 +1113,7 @@ ItemImpl::doChange(Keychain keychain, CSSM_DB_RECORDTYPE recordType, void (^tryC // The item on-disk might have more or different attributes than we do, since we're // only searching via primary key. Fetch all of its attributes. - auto_ptrdbDupAttributes (new DbAttributes(kc->database(), 1)); + unique_ptrdbDupAttributes (new DbAttributes(kc->database(), 1)); fillDbAttributesFromSchema(*dbDupAttributes, recordType, kc); // Occasionally this cursor won't return the item attributes (for an unknown reason). @@ -1526,7 +1526,7 @@ ItemImpl::getAttributesAndData(SecKeychainAttributeInfo *info, SecItemClass *ite theList->count = 0; theList->attr = NULL; } else { - SecKeychainAttribute *attr=reinterpret_cast(malloc(sizeof(SecKeychainAttribute)*attrCount)); + SecKeychainAttribute *attr=reinterpret_cast(calloc(attrCount, sizeof(SecKeychainAttribute))); theList->count=attrCount; theList->attr=attr;