[PATCH] Crash in KBookmarkManager

David Faure faure at kde.org
Wed Dec 5 15:45:54 GMT 2007

On Wednesday 05 December 2007, Tobias Koenig wrote:
> Hej,
> there was a bug report for okular that KBookmark(Manager) crashes
> (actual it asserts) when you try to add a bookmark to an empty (invalid
> xml) bookmark file. A similar report exists for konqueror as well.
> The problem is that if KBookmarkManager parses the xml document and
> doesn't find the document element, it just prints a warning and
> continues. Unfortunately some other code (e.g. KBookmarkManager::root())
> expects that there is always a document element... so the design is
> somehow broken.
> The attached patch fixes this issue by always creating a default
> document element if none is found. That fixes the crash and seems to be
> the logical way of doing it ;)

Yep, seems fine. Thanks for the fix.

David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

More information about the kde-core-devel mailing list