[evolution-data-server/gnome-3-10] Bug #720751 - camel_tag_set() doesn't copy tag's name properly



commit 0ca71c0ec12b6fcc83ed2d828fba586e356ff588
Author: Milan Crha <mcrha redhat com>
Date:   Thu Feb 6 18:21:17 2014 +0100

    Bug #720751 - camel_tag_set() doesn't copy tag's name properly

 camel/camel-folder-summary.c |    4 ++--
 camel/camel-lock-helper.c    |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 232f17f..a0e94b9 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -4230,7 +4230,7 @@ camel_flag_set (CamelFlag **list,
        if (value) {
                tmp_len = sizeof (*tmp) + strlen (name);
                tmp = g_malloc (tmp_len);
-               g_strlcpy (tmp->name, name, tmp_len);
+               g_strlcpy (tmp->name, name, strlen (name) + 1);
                tmp->next = NULL;
                flag->next = tmp;
        }
@@ -4383,7 +4383,7 @@ camel_tag_set (CamelTag **list,
 
        if (value) {
                tmp = g_malloc (sizeof (*tmp) + strlen (name));
-               g_strlcpy (tmp->name, name, sizeof (tmp->name));
+               g_strlcpy (tmp->name, name, strlen (name) + 1);
                tmp->value = g_strdup (value);
                tmp->next = NULL;
                tag->next = tmp;
diff --git a/camel/camel-lock-helper.c b/camel/camel-lock-helper.c
index 835d4e8..0d347b4 100644
--- a/camel/camel-lock-helper.c
+++ b/camel/camel-lock-helper.c
@@ -176,7 +176,7 @@ lock_path (const gchar *path,
                info->uid = lock_real_uid;
        }
 
-       g_strlcpy (info->path, path, sizeof (info->path));
+       g_strlcpy (info->path, path, strlen (path) + 1);
        info->id = lock_id;
        info->depth = 1;
        info->next = lock_info_list;


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