[Commits] [SCM] claws branch, master, updated. 3.10.1-117-g9ff86db

ticho at claws-mail.org ticho at claws-mail.org
Tue Jul 1 19:47:07 CEST 2014


The branch master of project "claws" (Claws Mail) has been updated
       via  9ff86db84bc2fdee00d1379fa875d2e6d9e48c2d (commit)
      from  45a6494a22ca888132efbf5f2096e57fd0fb1970 (commit)

Summary of changes:
 src/plugins/rssyl/libfeed/date.c          |    5 +++--
 src/plugins/rssyl/libfeed/feeditem.c      |    5 ++++-
 src/plugins/rssyl/libfeed/parser_atom10.c |    5 +++++
 src/plugins/rssyl/rssyl_add_item.c        |   10 +++++++---
 src/plugins/rssyl/rssyl_update_comments.c |    1 +
 src/plugins/rssyl/rssyl_update_feed.c     |    9 ++++++---
 6 files changed, 26 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit 9ff86db84bc2fdee00d1379fa875d2e6d9e48c2d
Author: Andrej Kacian <andrej at kacian.sk>
Date:   Tue Jul 1 19:14:47 2014 +0200

    RSSyl: more fixes for Coverity issues

diff --git a/src/plugins/rssyl/libfeed/date.c b/src/plugins/rssyl/libfeed/date.c
index 2b8ffff..c37756d 100644
--- a/src/plugins/rssyl/libfeed/date.c
+++ b/src/plugins/rssyl/libfeed/date.c
@@ -48,8 +48,9 @@ time_t parseISO8601Date(gchar *date) {
 	time_t		t, t2, offset = 0;
 	gboolean	success = FALSE;
 	gchar *pos;
-	
-	g_assert(date != NULL);
+
+	if (date == NULL)
+		return -1;
 	
 	memset(&tm, 0, sizeof(struct tm));
 	
diff --git a/src/plugins/rssyl/libfeed/feeditem.c b/src/plugins/rssyl/libfeed/feeditem.c
index d04831b..a85852e 100644
--- a/src/plugins/rssyl/libfeed/feeditem.c
+++ b/src/plugins/rssyl/libfeed/feeditem.c
@@ -352,7 +352,10 @@ FeedItem *feed_item_copy(FeedItem *item)
 	nitem->id_is_permalink = item->id_is_permalink;
 	nitem->xhtml_content = item->xhtml_content;
 
-	nitem->data = g_memdup(item->data, sizeof(item->data));
+	/* We have no way of knowing the size of object item->data is pointing
+	 * to, so we can not reliably copy it to the new item. Caller will have
+	 * to take care of that itself. */
+	nitem->data = NULL;
 
 	return nitem;
 }
diff --git a/src/plugins/rssyl/libfeed/parser_atom10.c b/src/plugins/rssyl/libfeed/parser_atom10.c
index c04e77c..64a4ffe 100644
--- a/src/plugins/rssyl/libfeed/parser_atom10.c
+++ b/src/plugins/rssyl/libfeed/parser_atom10.c
@@ -51,6 +51,11 @@ void feed_parser_atom10_start(void *data, const gchar *el, const gchar **attr)
 
 	} else if( ctx->depth == 2 ) {
 
+		/* This should only happen with malformed atom feeds - we're in
+		 * XML depth 2, but not inside an <entry> block. */
+		if (ctx->curitem == NULL)
+			return;
+
 		if( !strcmp(el, "author") ) {
 			/* Start of author info for current feed item.
 			 * Set correct location. */
diff --git a/src/plugins/rssyl/rssyl_add_item.c b/src/plugins/rssyl/rssyl_add_item.c
index 1dc3e78..49f4a23 100644
--- a/src/plugins/rssyl/rssyl_add_item.c
+++ b/src/plugins/rssyl/rssyl_add_item.c
@@ -373,11 +373,15 @@ void rssyl_add_item(RFolderItem *ritem, FeedItem *feed_item)
 	dirname = folder_item_get_path(&ritem->item);
 	template = g_strconcat(dirname, G_DIR_SEPARATOR_S,
 			RSSYL_TMP_TEMPLATE, NULL);
-	fd = mkstemp(template);
+	if ((fd = mkstemp(template)) < 0) {
+		g_warning("Couldn't mkstemp('%s'), not adding message!\n", template);
+		g_free(template);
+		return;
+	}
 
 	f = fdopen(fd, "w");
-	if(f == NULL) {
-		g_warning("Couldn't open file '%s', not adding msg!\n", template);
+	if (f == NULL) {
+		g_warning("Couldn't open file '%s', not adding message!\n", template);
 		g_free(template);
 		return;
 	}
diff --git a/src/plugins/rssyl/rssyl_update_comments.c b/src/plugins/rssyl/rssyl_update_comments.c
index c54142d..4b5cb33 100644
--- a/src/plugins/rssyl/rssyl_update_comments.c
+++ b/src/plugins/rssyl/rssyl_update_comments.c
@@ -85,6 +85,7 @@ void rssyl_update_comments(RFolderItem *ritem)
 			closedir(dp);
 			g_free(path);
 			debug_print("RSSyl: bailing out, app is exiting\n");
+			return;
 		}
 
 		if( (num = to_number(d->d_name)) > 0 && d->d_type == DT_REG ) {
diff --git a/src/plugins/rssyl/rssyl_update_feed.c b/src/plugins/rssyl/rssyl_update_feed.c
index 8a97f90..f7b4f54 100644
--- a/src/plugins/rssyl/rssyl_update_feed.c
+++ b/src/plugins/rssyl/rssyl_update_feed.c
@@ -61,7 +61,7 @@ static void *rssyl_fetch_feed_thr(void *arg)
 }
 
 /* rssyl_fetch_feed() */
-RFetchCtx *rssyl_fetch_feed(RFetchCtx *ctx, gboolean verbose)
+void rssyl_fetch_feed(RFetchCtx *ctx, gboolean verbose)
 {
 #ifdef USE_PTHREAD
 	pthread_t pt;
@@ -127,13 +127,16 @@ RFetchCtx *rssyl_fetch_feed(RFetchCtx *ctx, gboolean verbose)
 
 		ctx->success = FALSE;
 	} else {
-		if( ctx->feed == NULL || feed_get_title(ctx->feed) == NULL ) {
+		if( feed_get_title(ctx->feed) == NULL ) {
 			/* libcurl was happy, but libfeed wasn't */
 			debug_print("RSSyl: Error reading feed\n");
 			if( verbose )
 				alertpanel_error(_("No valid feed found at\n<b>%s</b>"),
 							feed_get_url(ctx->feed));
-			log_error(LOG_PROTOCOL, RSSYL_LOG_ERROR_NOFEED, ctx->feed->url);
+
+			log_error(LOG_PROTOCOL, RSSYL_LOG_ERROR_NOFEED,
+					feed_get_url(ctx->feed));
+
 			ctx->success = FALSE;
 		}
 	}

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list