Project

General

Profile

Bug #11767

Range#to_s and Range#inspect are not infected by the receiver

Added by nobu (Nobuyoshi Nakada) over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:71811]

Description

In general, to_s and inspect on a tainted object should result a tainted string.
Range seems the only exception.

code

p ("0".taint.."1").to_s.tainted?
p ("0".."1".taint).to_s.tainted?
p ("0".."1").taint.to_s.tainted?

expected result

prints true 3 times.

actual result

prints true, true, and false.

#1

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Status changed from Open to Closed

Applied in changeset r52868.


range.c: infected by the receiver

  • range.c (range_to_s): should be infected by the receiver. str2 infects by appending. [ruby-core:71811] [Bug #11767]

Updated by nagachika (Tomoyuki Chikanaga) over 4 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE

Backported into ruby_2_2 branch at r52873.

Updated by usa (Usaku NAKAMURA) over 4 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE to 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE

ruby_2_1 r52875 merged revision(s) 52868.

Also available in: Atom PDF