Changeset 221779 in webkit


Ignore:
Timestamp:
Sep 7, 2017 11:31:22 PM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK][WPE] UI process crash in WebBackForwardList::restoreFromState
https://bugs.webkit.org/show_bug.cgi?id=176303

Reviewed by Michael Catanzaro.

Ensure the current index provided by the session state is not out of actual item list bounds. This is a bug in
the session state decoder, but WebBackForwardList::backForwardListState() is already doing the check and using
the last item index instead, so it's not easy to know where the actual problem is. In any case we should
still protect the decoder.

  • UIProcess/API/glib/WebKitWebViewSessionState.cpp:

(decodeSessionState):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r221773 r221779  
     12017-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][WPE] UI process crash in WebBackForwardList::restoreFromState
     4        https://bugs.webkit.org/show_bug.cgi?id=176303
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Ensure the current index provided by the session state is not out of actual item list bounds. This is a bug in
     9        the session state decoder, but WebBackForwardList::backForwardListState() is already doing the check and using
     10        the last item index instead, so it's not easy to know where the actual problem is. In any case we should
     11        still protect the decoder.
     12
     13        * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
     14        (decodeSessionState):
     15
    1162017-09-07  Andy Estes  <aestes@apple.com>
    217
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp

    r220860 r221779  
    370370
    371371    if (hasCurrentIndex)
    372         sessionState.backForwardListState.currentIndex = currentIndex;
     372        sessionState.backForwardListState.currentIndex = std::min<uint32_t>(currentIndex, sessionState.backForwardListState.items.size() - 1);
    373373    return true;
    374374}
Note: See TracChangeset for help on using the changeset viewer.