Re: [PATCH] notmuch: Fix off-by-one errors if a header is >200 characters long.

Subject: Re: [PATCH] notmuch: Fix off-by-one errors if a header is >200 characters long.

Date: Thu, 03 Jun 2010 16:48:16 -0700

To: dme@dme.org, notmuch@notmuchmail.org

Cc:

From: Carl Worth


On Wed, 28 Apr 2010 11:45:41 +0100, dme@dme.org wrote:
> From: David Edmondson <dme@dme.org>
> 
> If a single header is more than 200 characters long a set of 'off by
> one' errors cause memory corruption.
...
> This is the cause of my segmentation fault (or bus error) during
> `notmuch reply'. The patch is for the 0.3.1 branch, but I'd expect
> that it will apply cleanly to master.

Thanks for the fix, David.

In my testing I found that it was a header of *exactly* 200 bytes that
caused a problem. I added a message with such a header to the test suite
and verified (with valgrind) that the old code was problematic.

I've now pushed out both your fix and the new test case.

-Carl (happy to be hacking on notmuch again)

-- 
carl.d.worth@intel.com
part-000.sig (application/pgp-signature)

Thread: