ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "U.Nakamura" <usa@garbagecollect.jp>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:33351] Re: [Ruby 1.9-Bug#4087][Open] String#scan(arg) taints results if arg is a Regexp but not if arg is a String
Date: Thu, 25 Nov 2010 13:31:44 +0900	[thread overview]
Message-ID: <20101125043143.87E2F6EB1C@zanzibar.garbagecollect.jp> (raw)
In-Reply-To: <4ced77c099573_36e6137a924e89dc@redmine.ruby-lang.org>

Hello,

In message "[ruby-core:33338] [Ruby 1.9-Bug#4087][Open] String#scan(arg) taints results if arg is a Regexp but not if arg is a String"
    on Nov.25,2010 05:38:28, <redmine@ruby-lang.org> wrote:
> Bug #4087: String#scan(arg) taints results if arg is a Regexp but not if arg is a String
> Is this intended?

Maybe not.
patch for trunk.
\f
Index: re.c
===================================================================
--- re.c	(revision 29923)
+++ re.c	(working copy)
@@ -2443,6 +2443,7 @@
     }
     ret = rb_reg_initialize(obj, RSTRING_PTR(str), RSTRING_LEN(str), enc,
 			    options, err, sourcefile, sourceline);
+    OBJ_INFECT(obj, str);
     RB_GC_GUARD(str);
     return ret;
 }
\f


Regards,
-- 
U.Nakamura <usa@garbagecollect.jp>

  reply	other threads:[~2010-11-25  4:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-24 20:38 [ruby-core:33338] [Ruby 1.9-Bug#4087][Open] String#scan(arg) taints results if arg is a Regexp but not if arg is a String Brian Ford
2010-11-25  4:31 ` U.Nakamura [this message]
2010-11-25  7:26   ` [ruby-core:33368] " Yukihiro Matsumoto
2010-11-26  0:57     ` [ruby-core:33390] [Ruby 1.9-Bug#4087][Closed] " Usaku NAKAMURA
2010-11-26  1:18     ` [ruby-core:33391] [Backport87-Backport#4087][Assigned] " Usaku NAKAMURA
2010-12-04  2:04     ` [ruby-core:33558] [Backport87-Backport#4087][Feedback] " Shyouhei Urabe
2010-12-04  6:37     ` [ruby-core:33561] [Backport87-Backport#4087][Closed] " Shyouhei Urabe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101125043143.87E2F6EB1C@zanzibar.garbagecollect.jp \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).