Bug 321160 - WebKit renders an empty view when fed text/plain which contains 0x00 characters
Summary: WebKit renders an empty view when fed text/plain which contains 0x00 characters
Status: RESOLVED FIXED
Alias: None
Product: trojita
Classification: Unmaintained
Component: Desktop GUI (show other bugs)
Version: git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Trojita default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-14 21:46 UTC by Jan Kundrát
Modified: 2013-06-16 09:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
The "text/plain" attachment which contains zero bytes msg_2282_1 (1.03 KB, text/plain)
2013-06-14 21:46 UTC, Jan Kundrát
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kundrát 2013-06-14 21:46:47 UTC
Created attachment 80517 [details]
The "text/plain" attachment which contains zero bytes msg_2282_1

The SimplePartWidget renders an empty page instead of the actual content when fed with the test data (a real-world example from the kdepim ML). The only "weird thing" I recognize in there are the null bytes within the contents, but I have no proof that this is what is causing troubles here.
Comment 1 Jan Kundrát 2013-06-16 09:42:25 UTC
Git commit 653e02203abe1211780633e962835827219a52dc by Jan Kundrát.
Committed on 15/06/2013 at 00:15.
Pushed by jkt into branch 'master'.

When decoding from unknown encoding and assuming UTF-8, be sure to not stop at first NULL byte

This does *not* fix #321160 (this code is not even triggered in this situation),
but it's a sane thing to do anyway. I guess that the code shall be audited for
other instances where we might silently truncate the data here; it's caused by
an implicit conversion from QByteArray to uchar*.

M  +1    -1    src/Imap/Encoders.cpp

http://commits.kde.org/trojita/653e02203abe1211780633e962835827219a52dc
Comment 2 Jan Kundrát 2013-06-16 09:42:27 UTC
Git commit 14efb142be63e7a25542ea09ad571ca320eaec16 by Jan Kundrát.
Committed on 15/06/2013 at 00:23.
Pushed by jkt into branch 'master'.

WebKit: convert plaintext input with NULL bytes without silent truncation

This does *not* fix HTML input containing null bytes. I don't know if this
problem is relevant for HTML e-mails as well.
REVIEW: 111030

M  +10   -1    src/Gui/SimplePartWidget.cpp

http://commits.kde.org/trojita/14efb142be63e7a25542ea09ad571ca320eaec16