X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/5c19dc3ae3bd8e40a9c028b0deddd50ff337692c..7e6b461318c8a779d91381531435a68ee4e8b6ed:/OSX/libsecurity_keychain/lib/KCEventNotifier.cpp?ds=inline diff --git a/OSX/libsecurity_keychain/lib/KCEventNotifier.cpp b/OSX/libsecurity_keychain/lib/KCEventNotifier.cpp index fd78da60..662e1dc4 100644 --- a/OSX/libsecurity_keychain/lib/KCEventNotifier.cpp +++ b/OSX/libsecurity_keychain/lib/KCEventNotifier.cpp @@ -69,11 +69,14 @@ void KCEventNotifier::PostKeychainEvent(SecKeychainEvent whichEvent, // flatten the dictionary CssmData data; nvd.Export (data); - - SecurityServer::ClientSession cs (Allocator::standard(), Allocator::standard()); - cs.postNotification (SecurityServer::kNotificationDomainDatabase, whichEvent, data); - secdebug("kcnotify", "KCEventNotifier::PostKeychainEvent posted event %u", (unsigned int) whichEvent); + /* enforce a maximum size of 16k for notifications */ + if (data.length() <= 16384) { + SecurityServer::ClientSession cs (Allocator::standard(), Allocator::standard()); + cs.postNotification (SecurityServer::kNotificationDomainDatabase, whichEvent, data); + + secinfo("kcnotify", "KCEventNotifier::PostKeychainEvent posted event %u", (unsigned int) whichEvent); + } free (data.data ()); }