Increase some limits in git-mailinfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm not proud of this patch, and I think we should do this better, but I 
just had trouble with an email that Eric Biederman sent me for the kernel, 
and this is the simplest and most obvious fix..

What happened is that Eric's email had a long and complex "References:" 
line in his email headers, and the way git-mailinfo parses email headers, 
it will combine these multi-line headers into one single long line (which 
is appropriate for things like Subject lines etc, where everybody really 
wants to just have one long subject rather than know about rfc822 email 
message rules).

However, with the extensive references, the end result was longer than the 
one thousand character line limit we had, and what git-mailinfo did was to 
just stop parsing header lines. The end result: it never parsed the 
"Date:" line at all, and it left all subsequent email header lines as 
"commit info" contents instead. Very ugly.

Arguably that is the real bug (we should continue with header parsing), 
but the trivial work-around is to just make the line buffer bigger.

Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
---

I'll look at making the parsing more robust too, but thought I'd send this 
out asap.

		Linus

---
 builtin-mailinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 6ee6b0b..3f0e08a 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -10,7 +10,7 @@ static FILE *cmitmsg, *patchfile, *fin, *fout;
 
 static int keep_subject;
 static const char *metainfo_charset;
-static char line[1000];
+static char line[10000];
 static char date[1000];
 static char name[1000];
 static char email[1000];
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]