Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Duplicate the cached value before writing it in the local cache #37587
Discovered by @eljojo.
I think the test case showcase the bug somewhat properly. In short it was already protecting itself from mutation of returned values, but not from mutation of the original value, e.g.:
my_string = "foo" cache.write('key', my_string) my_string << "bar" cache.read('key') # => "foobar"