[Users] [Bug 3598] use after free in function summary_execute_move_func()

noreply at thewildbeast.co.uk noreply at thewildbeast.co.uk
Sat Jan 23 14:54:01 CET 2016


http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=3598

--- Comment #5 from Hanno Boeck <hanno at hboeck.de> ---
>You would still need to assign NULL to your own pointer since adding msginfo = 
>NULL in procmsg_msginfo_free will only operate on what your a pointing to and 
>not your own pointer.

Exactly. That's what makes it complicated.

There are two ways out:
a) change procmsg_msginfo_free() to not operate on a pointer, but a pointer to
a pointer (**msginfo). Then you can pass &msginfo and zero that.
b) change each call of procmsg_msginfo_free() to have a subsequent msginfo =
NULL.

Option a) has the additional downside that this requires you to make this
change also within plugins.

Both options don't look very nice. There may be also option
c) add a new function procmsg_msginfo_free_pointer() which:
   * calls procmsg_msginfo_free()
   * sets the given pointer to NULL
This wouldn't outright break all existing code and it could be migrated slowly.
At some point you might then want to deprecate calling procmsg_msginfo_free
directly.

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Users mailing list