Re: [gmime-devel] parsing broken message_part inside a multipart



Opps, that last patch can cause a segfault when message part isn't
inside multipart, so this patch fixed that.

Regards.
From 4c996c02ab46647764dcd29ef4eb77269d8075b1 Mon Sep 17 00:00:00 2001
From: quatrix <evil legacy gmail com>
Date: Mon, 13 Feb 2012 00:13:54 +0200
Subject: [PATCH 2/2] oops, fixed segfault incase message part isn't inside multipart

---
 gmime/gmime-parser.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gmime/gmime-parser.c b/gmime/gmime-parser.c
index b2181ef..196859b 100644
--- a/gmime/gmime-parser.c
+++ b/gmime/gmime-parser.c
@@ -1667,6 +1667,10 @@ static gboolean
 found_immediate_boundary (struct _GMimeParserPrivate *priv, gboolean end)
 {
 	BoundaryStack *s = priv->bounds;
+
+	if (!s)
+		return 0;
+
 	size_t len = end ? s->boundarylenfinal : s->boundarylen;
 	
 	return !strncmp (priv->inptr, s->boundary, len)
-- 
1.7.0.2



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