develooper Front page | perl.perl5.changes | Postings from September 2021

[Perl/perl5] 23cca2: Don't try to Sv[PI]V() on an undef index SV infin...

Thread Previous
From:
Tony Cook via perl5-changes
Date:
September 22, 2021 01:48
Subject:
[Perl/perl5] 23cca2: Don't try to Sv[PI]V() on an undef index SV infin...
Message ID:
Perl/perl5/push/refs/heads/19147-uninit-warn-segfault/000000-23cca2@github.com
  Branch: refs/heads/19147-uninit-warn-segfault
  Home:   https://github.com/Perl/perl5
  Commit: 23cca2d1f4544cb47f1124d98c308ce1f31f09a6
      https://github.com/Perl/perl5/commit/23cca2d1f4544cb47f1124d98c308ce1f31f09a6
  Author: Tony Cook <tony@develop-help.com>
  Date:   2021-09-22 (Wed, 22 Sep 2021)

  Changed paths:
    M sv.c
    M t/lib/warnings/sv

  Log Message:
  -----------
  Don't try to Sv[PI]V() on an undef index SV in find_uninit_var()

When trying to evaluate:

  $x{$y}

or

  $x[$y]

where both the index and the hash or array entry was undefined,
when trying to report the entry as uninitialised, find_uninit_var()
would try to get the string or numeric value of the index,
recursively trying to produce a warning.

This would end up overflowing the stack, producing a segmentation fault.

Fixes #19147.



Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About