From 2d4bd0ad2d574ffff2359a88bfcf53e792c3c830 Mon Sep 17 00:00:00 2001 From: David Levine Date: Thu, 23 Oct 2008 18:38:22 +0000 Subject: [PATCH] * h/mh.h: raised NAMESZ from 128 to 999. RFC 2822 limits line lengths to 998 characters, so a header name can be at most that long. m_getfld limits header names to 2 less than NAMESZ, which is fine, because header names must be followed by a colon. Add one for terminating NULL. --- ChangeLog | 8 ++++++++ h/mh.h | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2ce209a..d69cbca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2008-10-23 David Levine + * h/mh.h: raised NAMESZ from 128 to 999. RFC 2822 limits line + lengths to 998 characters, so a header name can be at most that long. + m_getfld limits header names to 2 less than NAMESZ, which is fine, + because header names must be followed by a colon. Add one for + terminating NULL. + +2008-10-23 David Levine + * sbr/m_getfld.c: in warning message, use NAMESZ-2 instead of NAMESZ-1 bytes because the message says "exceeds", not "is greater than or equal to". diff --git a/h/mh.h b/h/mh.h index 97c7769..6513f24 100644 --- a/h/mh.h +++ b/h/mh.h @@ -223,7 +223,15 @@ struct msgs { * m_getfld() message parsing */ -#define NAMESZ 128 /* Limit on component name size */ +#define NAMESZ 999 /* Limit on component name size. + RFC 2822 limits line lengths to + 998 characters, so a header name + can be at most that long. + m_getfld limits header names to 2 + less than NAMESZ, which is fine, + because header names must be + followed by a colon. Add one for + terminating NULL. */ #define LENERR (-2) /* Name too long error from getfld */ #define FMTERR (-3) /* Message Format error */ -- 1.7.10.4