abrt/libreport — pull request #198 by dvlasenk (2013-11-01 12:34:58+00:00)
Title: Do not load "always editable" files if they are HUGE. Fixes rhbz1010167.

rhbz#1010167:
"abrt-cli list ends with Out of memory error for large files"

The reproducer has "reason" element with 1500 megabytes of /dev/zero.
This was OOMing the machine because "reason" is an editable item,
and we were treating such items as text and loading them always,
without checking their size.

The change fixes this particular oversight: it will always load
huge files as CD_FLAG_BIN. It will also flag huge, but seemingly
textual files with a new bit, CD_FLAG_BIGTXT. This allows us
to set MIME type of "text/plain" on such files.

With this change, we can roll back increases in CD_MAX_TEXT_SIZE:
we were making it large (8 mbytes) because otherwise big text files
were attached as "application/octet-stream". Now they will have
"text/plain" type.

Signed-off-by: Denys Vlasenko