Actions
Bug #11767
closedRange#to_s and Range#inspect are not infected by the receiver
    Bug #11767:
    Range#to_s and Range#inspect are not infected by the receiver
  
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.
        
           Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
          Updated by nobu (Nobuyoshi Nakada) almost 10 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) almost 10 years ago
          Updated by nagachika (Tomoyuki Chikanaga) almost 10 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) almost 10 years ago
          Updated by usa (Usaku NAKAMURA) almost 10 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.
Actions