[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:13:43 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 039a8a816ac667788a2970ddcd5b5fe1c5b53d4c
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 11 22:28:51 2002 +0000

    WebFoundation:
    
            Reviewed by Richard.
    
    	- fixed 3124837 -- Crash trying to handle weird javascript URL in page address field
    
            * Misc.subproj/WebNSURLExtras.h: Added _web_scriptIfJavaScriptURL for both NSURL and NSString,
    	and _web_stringByReplacingValidPercentEscapes.
            * Misc.subproj/WebNSURLExtras.m:
            (-[NSURL _web_scriptIfJavaScriptURL]): Added. Call the NSString version on our absoluteString.
            (isHexDigit): Added.
            (hexDigitValue): Added.
            (-[NSString _web_stringByReplacingValidPercentEscapes]): Added. Converts the sequences into
    	character, and then re-encodes as UTF-8. Added a FIXME about doing even better.
            (-[NSString _web_scriptIfJavaScriptURL]): Check for a javascript: prefix, then turn the suffix
    	into a script by replacing percent escapes.
    
            * English.lproj/StringsNotToBeLocalized.txt: Updated.
    
    WebCore:
    
            Reviewed by Richard.
    
    	- fixed 3124263 -- REGRESSION: Crash running development build of PLT
    
            * kwq/KWQWidget.mm:
            (QWidget::~QWidget): Don't worry about the outer view here, since we can never hit one of those.
    	Just pass the view to KWQKHTMLPart::widgetWillReleaseView.
            (QWidget::getOuterView): Re-add the assertion I had removed.
    
    	- fixed 3124837 -- Crash trying to handle weird javascript URL in page address field
    
            * kwq/KWQKURL.mm: (KURL::decode_string): Made this function return the URL still encoded
    	rather than a null string (actually, crashing) when CFURLCreateStringByReplacingPercentEscapes
    	rejects the passed-in string. Also updated the FIXME.
            (appendEscapingBadChars): Fixed problem with high-bit-set characters.
            * kwq/KWQString.mm: (QString::setBufferFromCFString): Made this tolerant of NULL.
    
    WebKit:
    
            Reviewed by Richard.
    
    	- fixed 3124837 -- Crash trying to handle weird javascript URL in page address field
    
            * Plugins.subproj/WebBaseNetscapePluginView.m:
            (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
    	Use the new _web_scriptIfJavaScriptURL to simplify the check for JavaScript URLs,
    	and to use a more tolerant unescaper.
    
            * English.lproj/StringsNotToBeLocalized.txt: Updated.
    
    WebBrowser:
    
            Reviewed by Richard.
    
    	- fixed 3124837 -- Crash trying to handle weird javascript URL in page address field
    
            * BrowserWebBookmarkExtras.m: (-[WebBookmark _goToWithWindowPolicy:]):
            * BrowserWindowController.m: (-[BrowserWindowController goToToolbarLocation:]):
    	Use the new _web_scriptIfJavaScriptURL to simplify the check for JavaScript URLs,
    	and to use a more tolerant unescaper.
    
            * BrowserWebController.m: (-[BrowserWebController mouseoverTextForElement:modifierFlags:]):
    	Use _web_stringByReplacingValidPercentEscapes, since it is more tolerant than
    	CFURLCreateStringByReplacingPercentEscapes.
    
            * English.lproj/StringsNotToBeLocalized.txt: Updated.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3004 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index c6a12bb..0add4dd 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,24 @@
 2002-12-11  Darin Adler  <darin at apple.com>
 
+        Reviewed by Richard.
+
+	- fixed 3124263 -- REGRESSION: Crash running development build of PLT
+
+        * kwq/KWQWidget.mm:
+        (QWidget::~QWidget): Don't worry about the outer view here, since we can never hit one of those.
+	Just pass the view to KWQKHTMLPart::widgetWillReleaseView.
+        (QWidget::getOuterView): Re-add the assertion I had removed.
+
+	- fixed 3124837 -- Crash trying to handle weird javascript URL in page address field
+
+        * kwq/KWQKURL.mm: (KURL::decode_string): Made this function return the URL still encoded
+	rather than a null string (actually, crashing) when CFURLCreateStringByReplacingPercentEscapes
+	rejects the passed-in string. Also updated the FIXME.
+        (appendEscapingBadChars): Fixed problem with high-bit-set characters.
+        * kwq/KWQString.mm: (QString::setBufferFromCFString): Made this tolerant of NULL.
+
+2002-12-11  Darin Adler  <darin at apple.com>
+
         Reviewed by John.
 
 	- fixed handling of mouse events so I could turn the mechanism on all the way
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c6a12bb..0add4dd 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,24 @@
 2002-12-11  Darin Adler  <darin at apple.com>
 
+        Reviewed by Richard.
+
+	- fixed 3124263 -- REGRESSION: Crash running development build of PLT
+
+        * kwq/KWQWidget.mm:
+        (QWidget::~QWidget): Don't worry about the outer view here, since we can never hit one of those.
+	Just pass the view to KWQKHTMLPart::widgetWillReleaseView.
+        (QWidget::getOuterView): Re-add the assertion I had removed.
+
+	- fixed 3124837 -- Crash trying to handle weird javascript URL in page address field
+
+        * kwq/KWQKURL.mm: (KURL::decode_string): Made this function return the URL still encoded
+	rather than a null string (actually, crashing) when CFURLCreateStringByReplacingPercentEscapes
+	rejects the passed-in string. Also updated the FIXME.
+        (appendEscapingBadChars): Fixed problem with high-bit-set characters.
+        * kwq/KWQString.mm: (QString::setBufferFromCFString): Made this tolerant of NULL.
+
+2002-12-11  Darin Adler  <darin at apple.com>
+
         Reviewed by John.
 
 	- fixed handling of mouse events so I could turn the mechanism on all the way
diff --git a/WebCore/kwq/KWQKURL.mm b/WebCore/kwq/KWQKURL.mm
index bf50f69..f32856c 100644
--- a/WebCore/kwq/KWQKURL.mm
+++ b/WebCore/kwq/KWQKURL.mm
@@ -698,14 +698,16 @@ QString KURL::prettyURL(int trailing) const
     return result;
 }
 
-QString KURL::decode_string(const QString& urlString)
+QString KURL::decode_string(const QString &urlString)
 {
-    // FIXME: do it yerself
-
     CFStringRef unescaped = CFURLCreateStringByReplacingPercentEscapes(NULL, urlString.getCFString(), CFSTR(""));
+    if (!unescaped) {
+        // FIXME: To avoid this error, we need to write our own unescaping function.
+        ERROR("CFURL found ill-formed escape sequences in %s", urlString.ascii());
+        return urlString;
+    }
     QString qUnescaped = QString::fromCFString(unescaped);
     CFRelease(unescaped);
-
     return qUnescaped;
 }
 
@@ -722,8 +724,8 @@ static void appendEscapingBadChars(char*& buffer, const char *strStart, size_t l
 	    *p++ = *str++;
 	} else if (IS_BAD_CHAR(*str)) {
 	    *p++ = '%';
-	    *p++ = hexDigits[(*str) / 16];
-	    *p++ = hexDigits[(*str) % 16];
+	    *p++ = hexDigits[(*str >> 4) & 0xF];
+	    *p++ = hexDigits[*str & 0xF];
 	    str++;
 	} else {
 	    *p++ = *str++;
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index 803f3fa..26f4545 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -705,6 +705,9 @@ QString QString::number(double n)
 
 void QString::setBufferFromCFString(CFStringRef cfs)
 {
+    if (!cfs) {
+        return;
+    }
     CFIndex size = CFStringGetLength(cfs);
     UniChar fixedSizeBuffer[1024];
     UniChar *buffer;
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 2c4844f..d87a64c 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -72,7 +72,7 @@ QWidget::QWidget(NSView *view)
 
 QWidget::~QWidget() 
 {
-    KWQKHTMLPart::widgetWillReleaseView(getOuterView());
+    KWQKHTMLPart::widgetWillReleaseView(data->view);
     [data->view release];
     delete data;
 }
@@ -360,6 +360,7 @@ NSView *QWidget::getOuterView() const
     // If this widget's view is a WebCoreFrameView the we resize its containing view, a WebView.
     // The scroll view contained by the WebView will be autosized.
     NSView *view = data->view;
+    ASSERT(view);
     if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
         view = [view superview];
         ASSERT(view);
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index cd00652..80b719a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,18 @@
 2002-12-11  Darin Adler  <darin at apple.com>
 
+        Reviewed by Richard.
+
+	- fixed 3124837 -- Crash trying to handle weird javascript URL in page address field
+
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
+	Use the new _web_scriptIfJavaScriptURL to simplify the check for JavaScript URLs,
+	and to use a more tolerant unescaper.
+
+        * English.lproj/StringsNotToBeLocalized.txt: Updated.
+
+2002-12-11  Darin Adler  <darin at apple.com>
+
         Reviewed by John.
 
 	- turned on the mechanism that passes events through WebCore, now that it's working better
diff --git a/WebKit/English.lproj/StringsNotToBeLocalized.txt b/WebKit/English.lproj/StringsNotToBeLocalized.txt
index 7f21f90..312a8d4 100644
--- a/WebKit/English.lproj/StringsNotToBeLocalized.txt
+++ b/WebKit/English.lproj/StringsNotToBeLocalized.txt
@@ -207,7 +207,6 @@
 "html"
 "http"
 "https"
-"javascript"
 "lastVisitedDate"
 "nullplugin"
 "text/"
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index beddaf2..9e13e27 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -831,8 +831,8 @@
             return NPERR_INVALID_URL;
         }
     } else {
-        if([[URL scheme] _web_isCaseInsensitiveEqualToString:@"javascript"]){
-            NSString *JSString = [(id)CFURLCreateStringByReplacingPercentEscapes(NULL, (CFStringRef)[[URL absoluteString] substringFromIndex:11], (CFStringRef)@"") autorelease];
+        NSString *JSString = [URL _web_scriptIfJavaScriptURL];
+        if(JSString){
             [[self controller] stringByEvaluatingJavaScriptFromString:JSString];
             if(notifyData){
                NPP_URLNotify(instance, [[URL absoluteString] cString], NPRES_DONE, notifyData);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list