perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

pp_pack: SvPV_force() pack(p/P, ...) arguments when writable

Open tonycoz opened this issue 1 year ago • 0 comments

pack("p"/"P") is generally pretty awful, but we document that you can pack("P") and then write to the pointer supplied, so make that safer by ensuring the PV isn't shared with other SVs.

Since _force() throws on a READONLY SV, and you shouldn't be writing to one, only _force() for a writable SV.

This is still broken when magic is involved, but we did document it as usable.

Fixes the UUID::FFI part of #22380

Some other modules (and UUID::FFI itself, really) will need XS fixes.

tonycoz avatar Jul 15 '24 04:07 tonycoz