summaryrefslogtreecommitdiffstats
path: root/src/rfc2388.c
diff options
context:
space:
mode:
authorNathan Angelacos <nangel@alpinelinux.org>2015-02-15 23:10:17 +0000
committerNathan Angelacos <nangel@alpinelinux.org>2015-02-15 23:10:17 +0000
commit22275203cc9f97b79ffdedcbe6b51e0086fa8cb6 (patch)
tree075d23cf40bf05ef77aabf9543ad09f0143d65e9 /src/rfc2388.c
parenta4474474e11094d5d9a227171b35ab0e90c0a60c (diff)
downloadhaserl-22275203cc9f97b79ffdedcbe6b51e0086fa8cb6.tar.bz2
haserl-22275203cc9f97b79ffdedcbe6b51e0086fa8cb6.tar.xz
Version bump to 0.9.34
Fixes for Lua 5.3 compatibility Move sys/fnctl.h to fnctl.h Applied Victor Cook's patch to rfc2388.c regarding crlf positioning in header data
Diffstat (limited to 'src/rfc2388.c')
-rw-r--r--src/rfc2388.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rfc2388.c b/src/rfc2388.c
index 971a2e1..621672c 100644
--- a/src/rfc2388.c
+++ b/src/rfc2388.c
@@ -399,6 +399,8 @@ rfc2388_handler (list_t * env)
buffer_t buf;
mime_var_t var;
+ int header_continuation;
+
/* prevent a potential unitialized free() - ISE-TPS-2014-008 */
var.name = NULL;
@@ -449,6 +451,9 @@ rfc2388_handler (list_t * env)
state = DISCARD;
str = boundary + 2; /* skip the leading crlf */
+
+ header_continuation = 0;
+
do
{
/* x is true if this token ends with a matchstr or is at the end of stream */
@@ -501,6 +506,7 @@ rfc2388_handler (list_t * env)
buffer_reset (&buf);
mime_var_init (&var);
state = HEADER;
+ header_continuation = 0;
str = crlf;
}
}
@@ -510,7 +516,7 @@ rfc2388_handler (list_t * env)
buffer_add (&buf, sbuf.segment, sbuf.len);
if (x)
{
- if (sbuf.len == 0)
+ if (sbuf.len == 0 && header_continuation == 0)
{ /* blank line */
buffer_reset (&buf);
state = CONTENT;
@@ -522,7 +528,13 @@ rfc2388_handler (list_t * env)
mime_tag_add (&var, (char *) buf.data);
buffer_reset (&buf);
}
+ header_continuation = 0;
}
+ else
+ {
+ // expect more data
+ header_continuation = 1;
+ }
break;
case CONTENT: