[Commits] [SCM] claws branch, master, updated. 3.10.1-159-g9e4d6e4

ticho at claws-mail.org ticho at claws-mail.org
Sun Sep 14 05:25:47 CEST 2014


The branch, master has been updated
       via  9e4d6e44b4b9324109d5d1aa045a94332109cc96 (commit)
      from  bf4283e51f4cb8e6014dd9f0b54b2c7a42410aa6 (commit)

Summary of changes:
 src/plugins/rssyl/parse822.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit 9e4d6e44b4b9324109d5d1aa045a94332109cc96
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sun Sep 14 05:24:07 2014 +0200

    RSSyl: Do not use g_strsplit_set() to get the ID from message file, since the ID itself can contain < or > characters. Should fix bug #3282.

diff --git a/src/plugins/rssyl/parse822.c b/src/plugins/rssyl/parse822.c
index 846fb6d..01a7f7b 100644
--- a/src/plugins/rssyl/parse822.c
+++ b/src/plugins/rssyl/parse822.c
@@ -50,7 +50,7 @@
  */
 FeedItem *rssyl_parse_folder_item_file(gchar *path)
 {
-	gchar *contents, **lines, **line, **splid;
+	gchar *contents, **lines, **line, **splid, *tmp, *tmp2;
 	GError *error = NULL;
 	FeedItem *item;
 	RFeedCtx *ctx;
@@ -138,10 +138,15 @@ FeedItem *rssyl_parse_folder_item_file(gchar *path)
 
 				/* ID */
 				if( !strcmp(line[0], "Message-ID") ) {
-					splid = g_strsplit_set(line[1], "<>", 3);
-					if( strlen(splid[1]) != 0 )
-						feed_item_set_id(item, splid[1]);
-					g_strfreev(splid);
+					if (line[1][0] != '<' || line[1][strlen(line[1])-1] != '>') {
+						debug_print("RSSyl: malformed Message-ID, ignoring...\n");
+					} else {
+						/* Get the ID from within < and >. */
+						tmp = line[1] + 1;
+						tmp2 = g_strndup(tmp, strlen(tmp) - 1);
+						feed_item_set_id(item, tmp2);
+						g_free(tmp2);
+					}
 				}
 
 				/* Feed comments */

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list