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

[Perl/perl5] f15a20: Avoid a use-after-free deleting 8-bit keys fromst...

From:
Nicholas Clark via perl5-changes
Date:
September 16, 2021 07:18
Subject:
[Perl/perl5] f15a20: Avoid a use-after-free deleting 8-bit keys fromst...
Message ID:
Perl/perl5/push/refs/heads/blead/d5a0a5-f15a20@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: f15a20bce3aaf0956e466389530be470aa2cabfe
      https://github.com/Perl/perl5/commit/f15a20bce3aaf0956e466389530be470aa2cabfe
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M ext/XS-APItest/t/hash.t
    M hv.c

  Log Message:
  -----------
  Avoid a use-after-free deleting 8-bit keys from stashes

This code path only affects symbol tables, and can't be reached by regular
Perl code. It is only reachable using the XS API to delete a key from a
stash where the key was in the 8-bit range but passed in UTF-8 encoded.

This has been in the code since it was added in Oct 2010 by commit
35759254f69c7bfa:
    Rename stashes when they move around

Also there is no need to call SvPV() on keysv in S_hv_delete_common() as
its caller has always already done this. This entire code is not KISS.





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