Project

General

Profile

Actions

Bug #5902

closed

Array#join with an unused, infected separator may or may not infect the result

Added by john_firebaugh (John Firebaugh) over 12 years ago. Updated almost 12 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]
Backport:
[ruby-core:42160]

Description

=begin
It's infected if the separator is unused because there is only one element, but not if there are zero elements. Is this intended behavior?

s = [].join(",".taint.untrust)
s.tainted? #=> false
s.untrusted? #=> false

s = [1].join(",".taint.untrust)
s.tainted? #=> true
s.untrusted? #=> true
=end


Files

bug-5902.diff (1.32 KB) bug-5902.diff nobu (Nobuyoshi Nakada), 01/17/2012 05:34 PM
array.c_join_one_trusted.patch (601 Bytes) array.c_join_one_trusted.patch duerst (Martin Dürst), 01/18/2012 03:56 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0