mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 4296c369f6757e8fe8938dc02053309753075971
parent 65b277df16cd64aa24abd3b6c50889110d295dca
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Fri, 29 Jul 2016 18:26:39 +0200

blaze822: blaze822_hdr_: off-by-one for first header

Diffstat:
blaze822.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/blaze822.c b/blaze822.c @@ -418,10 +418,12 @@ blaze822_hdr_(struct message *mesg, const char *hdr, size_t hdrlen) return 0; // header too small for the key, probably empty // special case: first header, no leading nul - if (memcmp(mesg->msg, hdr+1, hdrlen-1) == 0) + if (memcmp(mesg->msg, hdr+1, hdrlen-1) == 0) { v = mesg->msg; - else + hdrlen--; + } else { v = mymemmem(mesg->msg, mesg->end - mesg->msg, hdr, hdrlen); + } if (!v) return 0; v += hdrlen;