[evolution-data-server] Fix some issues found by Coverity Scan, cppcheck and clang
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Fix some issues found by Coverity Scan, cppcheck and clang
- Date: Mon, 16 May 2016 17:52:26 +0000 (UTC)
commit 789167ec7cb16cb5f666e8425ef85c9bafccf142
Author: Milan Crha <mcrha redhat com>
Date: Mon May 16 19:51:31 2016 +0200
Fix some issues found by Coverity Scan, cppcheck and clang
calendar/backends/file/e-cal-backend-file.c | 2 +-
camel/camel-mime-filter-enriched.c | 8 ++++++--
camel/camel-text-index.c | 3 +++
camel/providers/imapx/camel-imapx-server.c | 1 +
camel/providers/imapx/camel-imapx-utils.c | 2 +-
camel/providers/smtp/camel-smtp-transport.c | 1 +
libedataserver/e-data-server-util.c | 3 ++-
7 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/calendar/backends/file/e-cal-backend-file.c b/calendar/backends/file/e-cal-backend-file.c
index b8e0e43..ec9d4f6 100644
--- a/calendar/backends/file/e-cal-backend-file.c
+++ b/calendar/backends/file/e-cal-backend-file.c
@@ -2498,7 +2498,7 @@ e_cal_backend_file_modify_objects (ECalBackendSync *backend,
}
if (g_hash_table_lookup_extended (obj_data->recurrences, rid, (gpointer *) &real_rid,
(gpointer *) &recurrence)) {
- if (*old_components)
+ if (old_components)
*old_components = g_slist_prepend (*old_components,
e_cal_component_clone (recurrence));
/* remove the component from our data */
diff --git a/camel/camel-mime-filter-enriched.c b/camel/camel-mime-filter-enriched.c
index a8247b8..bb5dea0 100644
--- a/camel/camel-mime-filter-enriched.c
+++ b/camel/camel-mime-filter-enriched.c
@@ -242,8 +242,12 @@ enriched_to_html (CamelMimeFilter *mime_filter,
retry:
do {
- while (inptr < inend && outptr < outend && !strchr (" <>&\n", *inptr))
- *outptr++ = *inptr++;
+ while (inptr < inend && outptr < outend && !strchr (" <>&\n", *inptr)) {
+ *outptr = *inptr;
+
+ outptr++;
+ inptr++;
+ }
if (outptr == outend)
goto backup;
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
index 411a5c7..dbf5f8f 100644
--- a/camel/camel-text-index.c
+++ b/camel/camel-text-index.c
@@ -1679,6 +1679,9 @@ text_index_cursor_next (CamelIndexCursor *idc)
}
g_free (p->current);
+ p->current = NULL;
+ flags = 0;
+
camel_key_table_lookup (
tip->name_index, p->records[p->record_index],
&p->current, &flags);
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index ed3ea43..ea82111 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -1164,6 +1164,7 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
g_prefix_error (
error, "%s: ",
_("Error writing to cache stream"));
+ imapx_free_fetch (finfo);
return FALSE;
}
g_mutex_unlock (&is->priv->stream_lock);
diff --git a/camel/providers/imapx/camel-imapx-utils.c b/camel/providers/imapx/camel-imapx-utils.c
index 9c2bbeb..0d02dd0 100644
--- a/camel/providers/imapx/camel-imapx-utils.c
+++ b/camel/providers/imapx/camel-imapx-utils.c
@@ -1029,7 +1029,7 @@ imapx_parse_body_fields (CamelIMAPXInputStream *stream,
error:
imapx_free_body (cinfo);
- return cinfo;
+ return NULL;
}
CamelHeaderAddress *
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 9a6877a..de6bc6f 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -754,6 +754,7 @@ smtp_transport_authenticate_sync (CamelService *service,
goto break_and_lose;
g_free (respbuf);
+ respbuf = NULL;
/* send our challenge */
cmdbuf = g_strdup_printf ("%s\r\n", challenge);
diff --git a/libedataserver/e-data-server-util.c b/libedataserver/e-data-server-util.c
index 1eead56..60bb63d 100644
--- a/libedataserver/e-data-server-util.c
+++ b/libedataserver/e-data-server-util.c
@@ -292,7 +292,8 @@ e_util_utf8_strstrcase (const gchar *haystack,
nuni[nlen++] = g_unichar_tolower (unival);
}
/* NULL means there was illegal utf-8 sequence */
- if (!p) return NULL;
+ if (!p || !nlen)
+ return NULL;
o = haystack;
for (p = e_util_unicode_get_utf8 (o, &unival);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]