This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix recent double free in S_parse_gv_stash_name()
authorDavid Mitchell <davem@iabyn.com>
Wed, 3 Apr 2019 10:06:22 +0000 (11:06 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Apr 2019 10:06:22 +0000 (11:06 +0100)
commit06cbc317229e882f379e75eb3adf7cf9c071febd
tree0802f0af41f9017e3cc79dac06a8458767792f58
parent930ded6545f2602708b01c3a2fdfe43bcaf771a6
Fix recent double free in S_parse_gv_stash_name()

RT #133977

My recent commit v5.29.9-29-g657ed7c1c1 moved all buffer freeing to
the end of the function, but missed removing one of the existing frees.

The problem was spotted by James E Keenan and diagnosed by Tony Cook; I just
added a test.

A simple reproducer is

my $def = defined *{"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'x"};
gv.c
t/op/stash_parse_gv.t