]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_keychain/lib/KCEventNotifier.cpp
Security-58286.260.20.tar.gz
[apple/security.git] / OSX / libsecurity_keychain / lib / KCEventNotifier.cpp
index fd78da602e85ea52194ebde3025e230630a5551d..662e1dc4c3102d145bff85ccd9a694f18dbfeaf1 100644 (file)
@@ -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 ());
 }