1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-17 06:25:13 +01:00
git/t/t5100
Jeff King e9d7d10a7f mailinfo: avoid violating strbuf assertion
In handle_from, we calculate the end boundary of a section
to remove from a strbuf using strcspn like this:

  el = strcspn(buf, set_of_end_boundaries);
  strbuf_remove(&sb, start, el + 1);

This works fine if "el" is the offset of the boundary
character, meaning we remove up to and including that
character. But if the end boundary didn't match (that is, we
hit the end of the string as the boundary instead) then we
want just "el". Asking for "el+1" caught an out-of-bounds
assertion in the strbuf library.

This manifested itself when we got a 'From' header that had
just an email address with nothing else in it (the end of
the string was the end of the address, rather than, e.g., a
trailing '>' character), causing git-mailinfo to barf.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-19 19:36:56 -07:00
..
0010 git-mailinfo: Fix getting the subject from the in-body [PATCH] line 2008-07-13 17:21:15 -07:00
info-from.expect mailinfo: avoid violating strbuf assertion 2008-08-19 19:36:56 -07:00
info-from.in mailinfo: avoid violating strbuf assertion 2008-08-19 19:36:56 -07:00
info0001
info0002
info0003
info0004
info0005
info0006
info0007
info0008
info0009
info0010 git-mailinfo: Fix getting the subject from the in-body [PATCH] line 2008-07-13 17:21:15 -07:00
info0011 mailinfo: fix MIME multi-part message boundary handling 2008-08-09 01:26:35 -07:00
msg0001
msg0002
msg0003
msg0004
msg0005
msg0006
msg0007
msg0008
msg0009
msg0010 git-mailinfo: Fix getting the subject from the in-body [PATCH] line 2008-07-13 17:21:15 -07:00
msg0011 mailinfo: fix MIME multi-part message boundary handling 2008-08-09 01:26:35 -07:00
nul-b64.expect mailinfo: apply the same fix not to lose NULs in BASE64 and QP codepaths 2008-05-25 13:22:18 -07:00
nul-b64.in mailinfo: apply the same fix not to lose NULs in BASE64 and QP codepaths 2008-05-25 13:22:18 -07:00
nul-plain t5100: Avoid filename "nul" 2008-05-27 23:12:29 -07:00
patch0001
patch0002
patch0003
patch0004
patch0005
patch0006
patch0007
patch0008
patch0009
patch0010 git-mailinfo: Fix getting the subject from the in-body [PATCH] line 2008-07-13 17:21:15 -07:00
patch0011 mailinfo: fix MIME multi-part message boundary handling 2008-08-09 01:26:35 -07:00
sample.mbox mailinfo: re-fix MIME multipart boundary parsing 2008-08-18 22:05:02 -07:00