[gmime: 3/5] minor parser fixups
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime: 3/5] minor parser fixups
- Date: Tue, 21 Mar 2017 11:58:33 +0000 (UTC)
commit c655b8ecab610b317e58f21e28b51c85a3c06a97
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date: Tue Mar 21 07:44:09 2017 -0400
minor parser fixups
gmime/gmime-parser.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gmime/gmime-parser.c b/gmime/gmime-parser.c
index 9e4513e..82740a9 100644
--- a/gmime/gmime-parser.c
+++ b/gmime/gmime-parser.c
@@ -1103,7 +1103,7 @@ parser_step_headers (GMimeParser *parser)
}
if (!valid) {
- if (priv->format == GMIME_FORMAT_MBOX && (inptr - start) == 4
+ if (priv->format == GMIME_FORMAT_MBOX && (inptr - start) >= 5
&& !strncmp (start, "From ", 5))
goto next_message;
@@ -1124,7 +1124,7 @@ parser_step_headers (GMimeParser *parser)
} else if (priv->state == GMIME_PARSER_STATE_MESSAGE_HEADERS) {
/* Be a little more strict when scanning toplevel message
* headers, but remain lenient with From-lines. */
- if ((inptr - start) != 4 || strncmp (start, "From ", 5) != 0)
{
+ if ((inptr - start) < 5 || strncmp (start, "From ", 5) != 0) {
priv->state = GMIME_PARSER_STATE_ERROR;
return -1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]