#include <Security/SecKeychainItemPriv.h>
#include <SecBase.h>
#include <Security/SecBasePriv.h>
+#include <utilities/array_size.h>
using namespace KeychainCore;
using namespace CssmClient;
for (const SecKeychainAttribute *attr=attrList->attr; attr != end; ++attr)
{
const CSSM_DB_ATTRIBUTE_INFO *temp;
-
- if (attr->tag <' ') // ok, is this a key schema? Handle differently, just because we can...
+
+ // ok, is this a key schema? Handle differently, just because we can...
+ if (attr->tag <' ' && attr->tag < array_size(gKeyAttributeLookupTable))
{
temp = gKeyAttributeLookupTable[attr->tag];
}
Keychain &kc = *mCurrent;
- // Grab a read lock on the keychain
- StReadWriteLock __(*(kc->getKeychainReadWriteLock()), StReadWriteLock::Read);
-
Mutex* mutex = kc->getKeychainMutex();
StLock<Mutex> _(*mutex);