New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pos() does not get updated when running in taint mode #7147
Comments
From fany@noris.netCreated by fany@noris.netI discovered that the pos() of a string does not get updated This can be reproduced as follows: | $ echo foo | perl -le '$a = <>; a($a); sub a { $_[0] =~ m/\G./g; print pos $a }' I discovered the bug, because Text::Wrapper got into an endless I could reproduce it with various perl versions (5.005_03, 5.6.1 Perl Info
|
From @iabynOn Wed, Mar 03, 2004 at 10:13:17AM -0000, fany@noris.net (via RT) wrote:
Thanks for the report. P5Pers: the error occurs in pp_alemfast(), which does the $_[0] in the U32 lval = PL_op->op_flags & OPf_MOD; For some reason the aelemfast opcode isn't marked as OPf_MOD, and since It's too late in the evening for my poor brain to work out the correct Dave. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @rgsSetting OPf_MOD on the aelemfast op isn't a good solution, because this I don't think there is a good and efficient way to solve this problem For example, here's another instance of the same bug, this time with $ ./perl -le 'a(substr("fooo",0,3)); sub a { $_[0] =~ m/\G./g; print pos $ ./perl -le 'a("".substr("fooo",0,3)); sub a { $_[0] =~ m/\G./g; print |
From [Unknown Contact. See original ticket]Setting OPf_MOD on the aelemfast op isn't a good solution, because this I don't think there is a good and efficient way to solve this problem For example, here's another instance of the same bug, this time with $ ./perl -le 'a(substr("fooo",0,3)); sub a { $_[0] =~ m/\G./g; print pos $ ./perl -le 'a("".substr("fooo",0,3)); sub a { $_[0] =~ m/\G./g; print |
From @fanyCreated by @fanypos() and regex matching with \G does not work if a tainted value $ perl -Tle '$_=shift; /\G(.*)/g; print pos || "-"' foo This e.g. causes infinite loops in Locale::Maketext::Guts::_compile(). It works, however, if the value is assigned to a variable first $ perl -Tle 'x(shift); sub x { my $s = shift; $s =~ /\G(.*)/g; print pos $s || "-" }' foo The issue not only affects the perl version mentioned below but Regards, Perl Info
|
From module@renee-baecker.deThanks for your bug report! I think you have filed the same bug about |
The RT System itself - Status changed from 'new' to 'open' |
From @fany
Thanks! This is scary! :-) I didn't remember that one at all. Regards, -- |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#27344 (status was 'resolved')
Searchable as RT27344$
The text was updated successfully, but these errors were encountered: