This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #121366] avoid using an invalid SvPVX() in Perl_sv_pvn_force_flags
authorTony Cook <tony@develop-help.com>
Wed, 26 Mar 2014 03:31:57 +0000 (14:31 +1100)
committerTony Cook <tony@develop-help.com>
Wed, 26 Mar 2014 03:31:57 +0000 (14:31 +1100)
commite14119056960dbe28537c9870667b5b920d9d731
treed16dd5694afcc5e446897093dcc6b8b589b2ca53
parenta8509e91bb215baa6f3e9592e6f68e4407f89168
[perl #121366] avoid using an invalid SvPVX() in Perl_sv_pvn_force_flags

This would cause valgrind to complain about:

  vec($Foo, 0, 1) = 1; # for example

when $Foo was undef, since SvPVX()[1] isn't initialized until the SV is
at least a SVt_PV.

[1] well, sv_u.svu_rv, but sv_u is a union, so the same memory is
initialized.  This isn't technically legal from a C point of view,
but pointer types are compatible enough with each other for it to not
be an issue.
sv.c