| Summary: | kded4 crashes if a local page tries to store a cookie ("index out of range" assertion failed) | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | Frank Reininghaus <frank78ac> |
| Component: | kcookiejar | Assignee: | Konqueror Bugs <konqueror-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | brutus.bagrovic, frank78ac, mpyne |
| Priority: | NOR | ||
| Version First Reported In: | 4.1.0 | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Test case (to verify that you get no crash when loading the file from a remote server) | ||
|
Description
Frank Reininghaus
2008-08-31 21:17:49 UTC
I forgot to say that I got the crash in 4.1 and SVN trunk rev. 855403. The obvious fix is a patch like this (in kdelibs/kioslave/http/kcookiejar):
Index: kcookiejar.cpp
===================================================================
--- kcookiejar.cpp (revision 854524)
+++ kcookiejar.cpp (working copy)
@@ -516,7 +516,7 @@
extractDomains(_fqdn, domains);
if (domains.count() > 3)
_domain = domains[3];
- else
+ else if (!domains.isEmpty())
_domain = domains[0];
}
to check if the domains list is empty. That relies on the rest of KCookieJar being able to cope with that. Judging from the code I was reading and the test I did it seems KCookieJar can cope with that.
That still leaves the question of why is it this only happens if the page is saved locally though. I do know that a local CGI script does not cause this crash using the set-cookie: http header. I haven't tried reproducing the testcase html on a remote server however.
Created attachment 27177 [details] Test case (to verify that you get no crash when loading the file from a remote server) Michael, thanks for the quick reply and the patch. After applying it, I got no more kded4 crashes, and the cookie was set correctly. Maybe I should have been a bit more precise in my report: It's not only important to store the file locally, but also to access it via a "file:/" URL. Putting it on a local webserver and accessing it via "http://localhost/..." does not crash kded4. Loading it from a remote web server doesn't crash either (I've attached the test case for easy verification). Fixed by r856375/856379. *** Bug 170898 has been marked as a duplicate of this bug. *** |