[evolution-data-server/gnome-3-36] CamelFilterDriver: do_shell: NULL-terminate the arguments array



commit a5525499abf296d83d326357b998452b4216b551
Author: Milan Crha <mcrha redhat com>
Date:   Mon May 11 10:34:38 2020 +0200

    CamelFilterDriver: do_shell: NULL-terminate the arguments array
    
    NULL-terminate the arguments array, in case the callback expects
    the array to be also NULL-terminated, but do not count this element
    into the argument count.

 src/camel/camel-filter-driver.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/camel/camel-filter-driver.c b/src/camel/camel-filter-driver.c
index 77cb361b5..b79b7210b 100644
--- a/src/camel/camel-filter-driver.c
+++ b/src/camel/camel-filter-driver.c
@@ -1252,6 +1252,9 @@ do_shell (struct _CamelSExp *f,
        g_string_truncate (command, command->len - 1);
 
        if (driver->priv->shellfunc && argc >= 1) {
+               /* NULL-terminate the array, but do not count it into the argc */
+               g_ptr_array_add (args, NULL);
+
                driver->priv->shellfunc (driver, argc, (gchar **) args->pdata, driver->priv->shelldata);
                camel_filter_driver_log (
                        driver, FILTER_LOG_ACTION,


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