2009-01-31 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Feb 2009 00:14:12 +0000 (00:14 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Feb 2009 00:14:12 +0000 (00:14 +0000)
        Reviewed by Mark Rowe.

        Fix code that assumes all command selectors end in colons.
        rdar://problem/6545874

        * WebView/WebHTMLView.mm:
        (commandNameForSelector): Don't assert, just return a null string, when
        the selector doesn't end in a colon.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@40465 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/mac/ChangeLog
WebKit/mac/WebView/WebHTMLView.mm

index d06aff5..c7e9ba7 100644 (file)
@@ -1,3 +1,14 @@
+2009-01-31  Darin Adler  <darin@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Fix code that assumes all command selectors end in colons.
+        rdar://problem/6545874
+
+        * WebView/WebHTMLView.mm:
+        (commandNameForSelector): Don't assert, just return a null string, when
+        the selector doesn't end in a colon.
+
 2009-01-30  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Sam Weinig.
index f709ecb..6d78b47 100644 (file)
@@ -2167,8 +2167,8 @@ static String commandNameForSelector(SEL selector)
     // Remove the trailing colon.
     const char* selectorName = sel_getName(selector);
     size_t selectorNameLength = strlen(selectorName);
-    ASSERT(selectorNameLength >= 2);
-    ASSERT(selectorName[selectorNameLength - 1] == ':');
+    if (selectorNameLength < 2 || selectorName[selectorNameLength - 1] != ':')
+        return String();
     return String(selectorName, selectorNameLength - 1);
 }
 
@@ -4889,7 +4889,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
     return (!_private->receivedNOOP && parameters.eventWasHandled) || parameters.consumedByIM;
 }
 
-- (WebCore::CachedImage*)promisedDragTIFFDataSource 
+- (WebCore::CachedImage*)promisedDragTIFFDataSource
 {
     return _private->promisedDragTIFFDataSource;
 }