develooper Front page | perl.perl5.porters | Postings from August 2016

[perl #129058] Perl_do_vop: resulting string isn't alwaysnull-terminated

Thread Next
From:
Dan Collins via RT
Date:
August 23, 2016 17:33
Subject:
[perl #129058] Perl_do_vop: resulting string isn't alwaysnull-terminated
Message ID:
rt-4.0.24-19059-1471973579-674.129058-15-0@perl.org
Upon further review, the AND case is deliberately different than the OR and XOR cases. I can tell because when I applied my patch that has the AND case just jump to mop_up_utf, the test suite failed a lot in t/op/bop.t. So instead I'll be a bit less heavy-handed and just pull in the line that NUL-terminates the string. This passes all tests (woo!).

My question - there was a recent discussion about whether perl strings could be assumed to be null-terminated. The outcome, as I understand it, was that perl strings would usually be null-terminated, but XS code could produce SVs with unterminated strings. So while this patch fixes one issue by null-terminating this particular string, a question: Is it safe, in the general case, for Perl_my_atof2() to use strlen? If not, there are surely more similar bugs hiding out. (That discussion was in RT #128170)

-- 
Respectfully,
Dan Collins

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=129058

Thread Next


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