Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
8984de56
...
8984de567ab8a517deedf4aa99a879ccd945c034
authored
2007-05-09 07:57:01 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(_mime_parse_mpart_message): One more fix
1 parent
030678a1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
mailbox/mime.c
mailbox/mime.c
View file @
8984de5
...
...
@@ -334,24 +334,34 @@ _mime_parse_mpart_message (mu_mime_t mime)
{
mime
->
parser_state
=
MIME_STATE_HEADERS
;
mime
->
flags
&=
~
MIME_PARSER_HAVE_CR
;
mb_length
=
mime
->
cur_offset
-
mb_offset
-
mime
->
line_ndx
;
mb_length
=
mime
->
cur_offset
-
mb_offset
-
mime
->
line_ndx
;
if
(
mime
->
header_length
)
/* this skips the preamble */
{
/* RFC 1521 [Page 30]:
NOTE: The CRLF preceding the encapsulation line
is conceptually attached to the boundary so
that it is possible to have a part that does
not end with a CRLF (line break). Body parts
that must be considered to end with line
NOTE: The CRLF preceding the encapsulation
line is conceptually attached to the boundary
so that it is possible to have a part that
does not end with a CRLF (line break). Body
parts
that must be considered to end with line
breaks, therefore, must have two CRLFs
preceding the encapsulation line, the first
of which is part of the preceding body part,
and the second of which is part of the
encapsulation boundary. */
if
(
mb_lines
)
/* to prevent negative values in case of a
malformed message */
mb_lines
--
;
_mime_append_part
(
mime
,
NULL
,
mb_offset
,
mb_length
,
mb_lines
-
1
);
mb_lines
);
}
if
((
&
mime
->
cur_line
[
mime
->
line_ndx
]
-
cp2
-
1
>
blength
&&
!
strncasecmp
(
cp2
+
blength
+
2
,
"--"
,
2
))
...
...
@@ -361,13 +371,15 @@ _mime_parse_mpart_message (mu_mime_t mime)
{
/* last boundary */
mime
->
parser_state
=
MIME_STATE_BEGIN_LINE
;
mime
->
header_length
=
0
;
break
;
}
mime
->
line_ndx
=
-
1
;
/* headers parsing requires empty line */
else
mime
->
line_ndx
=
-
1
;
/* headers parsing requires
empty line */
break
;
}
}
else
if
(
mime
->
header_length
)
if
(
mime
->
header_length
)
mb_lines
++
;
mime
->
line_ndx
=
0
;
...
...
Please
register
or
sign in
to post a comment