Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 532890 - mail-client/mutt - UTF8 related off-by-one bug in 07-quote.patch
Summary: mail-client/mutt - UTF8 related off-by-one bug in 07-quote.patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-17 21:21 UTC by Alex Efros
Modified: 2015-02-24 12:04 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
mutt-vim-reply-bug.mbox (mutt-vim-reply-bug.mbox,2.38 KB, application/mbox)
2014-12-17 21:21 UTC, Alex Efros
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2014-12-17 21:21:48 UTC
Created attachment 391890 [details]
mutt-vim-reply-bug.mbox

Full story at http://dev.mutt.org/trac/ticket/3718

In short, all current versions in portage (1.5.22-r3 - 1.5.23-r4) has utf8-related off-by-one bug in gentoo-specific 07-quote.patch.

To see this issue open attached mutt-vim-reply-bug.mbox - it contains just one email - and try to reply to this email. Mutt will output broken utf8 to $EDITOR (last symbol in quoted line will have only first of two utf8 bytes).

You can use this to catch file with mutt's output:
$ EDITOR="cp -t ." /usr/bin/mutt -n -F /dev/null -f /tmp/mutt-vim-reply-bug.mbox
$ ls -ltr   # last (newest) file is the one

To make sure problem is in mentioned patch just add this:
	sed -i '/handler.c/,$d' "${PATCHDIR}"/07-quote.patch
into ebuild before:
	for p in "${PATCHDIR}"/[0-9][0-9]-*.patch ; do
(it will disable that patch without breaking following patches).
Comment 1 Kevin J. McCarthy 2014-12-17 22:31:45 UTC
I'd be willing to bet this is because the patch uses
   char qbuf[2 * LONG_STRING];
Where LONG_STRING is 1024.

Your sample email is one long line of length 2047.  Add the quoted string "> " and voila, the snprintf will truncate the last byte.
Comment 2 Fabian Groffen gentoo-dev 2015-01-10 20:04:24 UTC
I've created an alternative patch, which I'm testing at the moment.
Comment 3 Fabian Groffen gentoo-dev 2015-01-10 20:42:25 UTC
please test 1.5.23-r5
Comment 4 Fabian Groffen gentoo-dev 2015-02-24 12:04:31 UTC
Assuming fixed.