Summary: | CGI kioslave adds random space! | ||
---|---|---|---|
Product: | [Frameworks and Libraries] kio | Reporter: | Tim Hutt <tdhutt> |
Component: | cgi | Assignee: | Cornelius Schumacher <schumacher> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Fix slightly corrupted output in CGI kioslave. |
Description
Tim Hutt
2005-12-18 02:40:47 UTC
I can confirm this. The problem is that there is code to try and extract the Content-Type, which uses QCString (a subclass of QByteArray). The QCString has the property that it always ends in '\0'. (i.e. [ d, a, t, a, \0 ]). When the QCString buffer is later transferred to KIO, KIO sends all of it, including the trailing '\0' which was not there before. I will attach a patch which fixes the issue (at least in my testing). At first I was just going to convert back to a QByteArray and send the plain QByteArray, but the underlying issue is that QCString is designed for text, not binary data, so I decided to fix that instead. It is understandably more invasive that way so I would like to get the patch reviewed before committing. Created attachment 16733 [details]
Fix slightly corrupted output in CGI kioslave.
This patch fixes the issue by using QByteArray for everything dealing with the
data from the buffer we're reading into.
This is fixed in KDE 3.5, fix will be included in the next release. KDE 4 seems to be unaffected thanks to the API changes in Qt, so no patch was applied there. |