RE: 3 Win32::API bugs
[email protected] (bulk 88)
| Newsgroups | perl.libwin32 |
|---|---|
| Message-ID | <[email protected]> |
I reached an interesting problem. I added buffer overflow protection to SVPV pointer types. Win32::API's own test suite died from a buffer overflow here https://github.com/cosimo/perl5-win32-api/blob/45847136293a8d6939fc319f91702d0b91287726/t/00_API.t#L115 . The sentinal pattern is 2 wide nulls and a 64 bit number, no alignment padding. At the github link, 1.0 becomes PV "31 [char "1"] 00 00 00 00 [2 wide nulls] e6 85 69 6f 42 09 00 00 [64bit randomish number] 00[perl's end of scalar null]" with SvCUR 13. A double is 8 bytes. Buffer overflow protection trips. So what a dilemma. Backwards compatibility means ignoring memory corruption. I think its irresponsible to turn off a major security/stability improvement for any reason, I'm leaving it on. Comments?