talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit e66db4b2667173badcffbf652b850857f0d3d94f
parent 3ba77c4ef28c35a9f331606c7f531f4cf94e39c6
Author: wwp <subscript@free.fr>
Date:   Mon,  4 Oct 2021 10:39:08 +0200

Fix  (in a better way) CID 1491324: use after free.

Diffstat:
Msrc/prefs_filtering.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/prefs_filtering.c b/src/prefs_filtering.c @@ -795,13 +795,15 @@ static void delete_path(GSList ** p_filters, const gchar * path) prefixlen = destlen - pathlen; suffix = action->destination + prefixlen; - if (suffix && !strncmp(path, suffix, pathlen)) { + if ((suffix && !strncmp(path, suffix, pathlen)) && filtering) { filters = g_slist_remove(filters, filtering); filteringprop_free(filtering); + filtering = NULL; } - } else if (strcmp(action->destination, path) == 0) { + } else if ((strcmp(action->destination, path) == 0) && filtering) { filters = g_slist_remove(filters, filtering); filteringprop_free(filtering); + filtering = NULL; } } }