]> granicus.if.org Git - neomutt/commit
Fix setenv overwriting to not truncate the envlist. (see #3922)
authorKevin McCarthy <kevin@8t8.us>
Mon, 20 Mar 2017 17:16:03 +0000 (10:16 -0700)
committerKevin McCarthy <kevin@8t8.us>
Mon, 20 Mar 2017 17:16:03 +0000 (10:16 -0700)
commit1096914a7c45c1e6f1eef045406636c6ef011eb4
tree00061ad20ef6ab3d79a424da0fa1b2b072a23571
parent2df2921fd3164b4541dcc8e5d6006edde5b4bf17
Fix setenv overwriting to not truncate the envlist. (see #3922)

The refactor in 2b9c40f13e13 exposed a bug I hadn't noticed.  The
match loop performed a FREE() on the slot.  Then, below, it was
checking if (*envp) to see whether it was overwriting or creating a
new slot.  However, FREE() nulls out *envp.  This would end up
truncating the envlist just after the set slot!

Move the free down, using a mutt_str_replace(), when overwriting the
slot.
init.c