2011-02-08 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Feb 2011 05:40:13 +0000 (05:40 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Feb 2011 05:40:13 +0000 (05:40 +0000)
        Reviewed by Mark Rowe.

        Crash when going back/forward when back/forward list is in a bad state.
        https://bugs.webkit.org/show_bug.cgi?id=54059
        <rdar://problem/8975244>

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::goForward): Add a null check.
        (WebKit::WebPageProxy::goBack): ditto

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp

index c960b1bf7b127411b7f81557c8c7de5f90831dd7..1b5c22e0ddda8797d9c35c5d5d0af090b791e936 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-08  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Crash when going back/forward when back/forward list is in a bad state.
+        https://bugs.webkit.org/show_bug.cgi?id=54059
+        <rdar://problem/8975244>
+        
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::goForward): Add a null check.
+        (WebKit::WebPageProxy::goBack): ditto
+
 2011-02-08  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Beth Dakin.
index 35ed1088cb246cff59594cd14d42341f4f37caf6..943348f87acab653cebcffebc5c84f6b88ea8dcc 100644 (file)
@@ -408,14 +408,16 @@ void WebPageProxy::goForward()
     if (isValid() && !canGoForward())
         return;
 
-    setPendingAPIRequestURL(m_backForwardList->forwardItem()->url());
+    WebBackForwardListItem* forwardItem = m_backForwardList->forwardItem();
+    if (forwardItem)
+        setPendingAPIRequestURL(forwardItem->url());
 
     if (!isValid()) {
-        reattachToWebProcessWithItem(m_backForwardList->forwardItem());
+        reattachToWebProcessWithItem(forwardItem);
         return;
     }
 
-    process()->send(Messages::WebPage::GoForward(m_backForwardList->forwardItem()->itemID()), m_pageID);
+    process()->send(Messages::WebPage::GoForward(forwardItem->itemID()), m_pageID);
 }
 
 bool WebPageProxy::canGoForward() const
@@ -428,14 +430,16 @@ void WebPageProxy::goBack()
     if (isValid() && !canGoBack())
         return;
 
-    setPendingAPIRequestURL(m_backForwardList->backItem()->url());
+    WebBackForwardListItem* backItem = m_backForwardList->backItem();
+    if (backItem)
+        setPendingAPIRequestURL(backItem->url());
 
     if (!isValid()) {
-        reattachToWebProcessWithItem(m_backForwardList->backItem());
+        reattachToWebProcessWithItem(backItem);
         return;
     }
 
-    process()->send(Messages::WebPage::GoBack(m_backForwardList->backItem()->itemID()), m_pageID);
+    process()->send(Messages::WebPage::GoBack(backItem->itemID()), m_pageID);
 }
 
 bool WebPageProxy::canGoBack() const