Issue #11760 has been updated by Tomoyuki Chikanaga.

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

Backported into `ruby_2_2` branch at r52974.

----------------------------------------
Bug #11760: Encoding is tainted unexpectedly by Marshal.load
https://bugs.ruby-lang.org/issues/11760#change-55362

* Author: Nobuyoshi Nakada
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: r52850
* Backport: 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE
----------------------------------------
By `Marshal.load`ing tainted source, `Encoding` object will be tainted.

## code to reproduce
~~~ruby
e = Encoding::UTF_8
p e.tainted?
p e == Marshal.load(Marshal.dump(e).taint)
p e.tainted?
~~~

## expected results
`false`, `true`, and `false`

## actual results
`false`, `true`, and `true`




-- 
https://bugs.ruby-lang.org/