Bug 28711 - Qt WebKit crash in QWebHistory::saveState()
Summary: Qt WebKit crash in QWebHistory::saveState()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-25 08:11 PDT by Jędrzej Nowacki
Modified: 2009-08-27 05:27 PDT (History)
1 user (show)

See Also:


Attachments
Path to QWebHistory::clear() (5.24 KB, patch)
2009-08-25 08:20 PDT, Jędrzej Nowacki
ariya.hidayat: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jędrzej Nowacki 2009-08-25 08:11:46 PDT
Qt WebKit crash in QWebHistory::saveState() if history instance was created from empty QWebPage and loaded by QWebHistory::restoreState(). 

Example, this code cause crash:
{
    QByteArray tmp = hist->saveState();
    QWebPage* page2 = new QWebPage(this);
    QWebHistory* hist2 = page2->history();
    for (unsigned i = 0; i < 5; i++){
        hist2->restoreState(tmp);
        hist2->saveState();
    }
    delete page2;
}

Of course, the application should not crash :-)
Comment 1 Jędrzej Nowacki 2009-08-25 08:20:21 PDT
Created attachment 38546 [details]
Path to QWebHistory::clear()

QWebHistory::clear() shouldn't create empty entry (item) if QWebHistory::count()<1;

Additional autotests were added.
Comment 2 Ariya Hidayat 2009-08-27 05:27:48 PDT
Landed r47818
in http://trac.webkit.org/changeset/47818