]> 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)
committerRichard Russon <rich@flatcap.org>
Tue, 21 Mar 2017 16:11:38 +0000 (16:11 +0000)
commitb087fd11c9ffd85bfb3a2d05a5c2801082a0ed70
treeff399b518140f33519a7dd3f088baa4c0df74413
parent2a4b61ecb3b4b6144affaee27ccbd7ad64618d99
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