[PATCH] Crash in KBookmarkManager

Tobias Koenig tokoe at kde.org
Wed Dec 5 13:16:47 GMT 2007


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 ;)

Ok for commit?

Ciao,
Tobias

P.S.: I'll commit a slightly different patch, for better overview I
      didn't changed the indentation in the attached one.
-- 
Separate politics from religion and economy!
The Council of the European Union is an undemocratic and illegal institution!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kio_bookmark.patch
Type: text/x-diff
Size: 1135 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071205/01df84ff/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071205/01df84ff/attachment.sig>


More information about the kde-core-devel mailing list