[Commits] [SCM] claws branch, master, updated. 3.17.3-172-g7d4d219

ticho at claws-mail.org ticho at claws-mail.org
Tue Apr 30 23:03:46 CEST 2019


The branch, master has been updated
       via  7d4d2199593a85aefee2fb3d9a6645451c35196a (commit)
      from  d405b9c5472922f089c200eae12d27911950f358 (commit)

Summary of changes:
 src/plugins/rssyl/libfeed/feeditem.c          |    2 +-
 src/plugins/rssyl/libfeed/feeditemenclosure.c |    9 +++++++++
 src/plugins/rssyl/libfeed/feeditemenclosure.h |    2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)


- Log -----------------------------------------------------------------
commit 7d4d2199593a85aefee2fb3d9a6645451c35196a
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Tue Apr 30 23:03:03 2019 +0200

    Fix a memory corruption bug in RSSyl's feed_item_copy()

diff --git a/src/plugins/rssyl/libfeed/feeditem.c b/src/plugins/rssyl/libfeed/feeditem.c
index 340cbf5..8d9faaa 100644
--- a/src/plugins/rssyl/libfeed/feeditem.c
+++ b/src/plugins/rssyl/libfeed/feeditem.c
@@ -344,7 +344,7 @@ FeedItem *feed_item_copy(FeedItem *item)
 	nitem->comments_url = g_strdup(item->comments_url);
 	nitem->parent_id = g_strdup(item->parent_id);
 
-	nitem->enclosure = g_memdup(item->enclosure, sizeof(FeedItemEnclosure));
+	nitem->enclosure = feed_item_enclosure_copy(item->enclosure);
 
 	nitem->date_published = item->date_published;
 	nitem->date_modified = item->date_modified;
diff --git a/src/plugins/rssyl/libfeed/feeditemenclosure.c b/src/plugins/rssyl/libfeed/feeditemenclosure.c
index 183cfb5..7f55961 100644
--- a/src/plugins/rssyl/libfeed/feeditemenclosure.c
+++ b/src/plugins/rssyl/libfeed/feeditemenclosure.c
@@ -98,3 +98,12 @@ void feed_item_enclosure_set_size(FeedItemEnclosure *enclosure, gulong size)
 
 	enclosure->size = size;
 }
+
+FeedItemEnclosure *feed_item_enclosure_copy(FeedItemEnclosure *enclosure)
+{
+	if (enclosure == NULL)
+		return NULL;
+
+	return feed_item_enclosure_new(enclosure->url, enclosure->type,
+			enclosure->size);
+}
diff --git a/src/plugins/rssyl/libfeed/feeditemenclosure.h b/src/plugins/rssyl/libfeed/feeditemenclosure.h
index ba4d127..69e9eff 100644
--- a/src/plugins/rssyl/libfeed/feeditemenclosure.h
+++ b/src/plugins/rssyl/libfeed/feeditemenclosure.h
@@ -40,4 +40,6 @@ void feed_item_enclosure_set_type(FeedItemEnclosure *enclosure, gchar *type);
 gulong feed_item_enclosure_get_size(FeedItemEnclosure *enclosure);
 void feed_item_enclosure_set_size(FeedItemEnclosure *enclosure, gulong size);
 
+FeedItemEnclosure *feed_item_enclosure_copy(FeedItemEnclosure *enclosure);
+
 #endif /* __FEEDITEMENCLOSURE_H */

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list