]> git.cworth.org Git - obsolete/notmuch-old/commit
notmuch: Fix off-by-one errors if a header is >200 characters long.
authorDavid Edmondson <dme@dme.org>
Wed, 28 Apr 2010 10:45:41 +0000 (11:45 +0100)
committerCarl Worth <cworth@cworth.org>
Tue, 1 Jun 2010 23:09:29 +0000 (16:09 -0700)
commit1671eaecdb69133bc88fd212c77b68122fa27600
tree197b485e31aef0f2e7edd6716e24399711d2e4e1
parent1d528f890ad34d0de596b09024f35216947de063
notmuch: Fix off-by-one errors if a header is >200 characters long.

If a single header is more than 200 characters long a set of 'off by
one' errors cause memory corruption.

When allocating memory with:
     a = malloc (len);
the last usable byte of the memory is 'a + len - 1' rather than 'a +
len'.

Fix the same bug when calculating the current offset should the buffer
used for collecting the output header need to be reallocated.
gmime-filter-headers.c