[evolution-data-server/gnome-3-36] I#213 - camel_mime_filter_backup() calls memcpy(null, ...)



commit 09f977710b1da588098b5953002481d256497c58
Author: Milan Crha <mcrha redhat com>
Date:   Wed May 13 20:00:50 2020 +0200

    I#213 - camel_mime_filter_backup() calls memcpy(null, ...)
    
    Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/213

 src/camel/camel-mime-filter.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/camel/camel-mime-filter.c b/src/camel/camel-mime-filter.c
index 2b6c57914..23b1032cf 100644
--- a/src/camel/camel-mime-filter.c
+++ b/src/camel/camel-mime-filter.c
@@ -312,8 +312,11 @@ camel_mime_filter_backup (CamelMimeFilter *filter,
                filter->backbuf = g_malloc (length + BACK_HEAD);
                filter->backsize = length + BACK_HEAD;
        }
+
        filter->backlen = length;
-       memcpy (filter->backbuf, data, length);
+
+       if (length || filter->backbuf)
+               memcpy (filter->backbuf, data, length);
 }
 
 /**


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