diff options
-rw-r--r-- | activesupport/lib/active_support/message_verifier.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/message_verifier.rb b/activesupport/lib/active_support/message_verifier.rb index 8d14423d91..3e72100bd9 100644 --- a/activesupport/lib/active_support/message_verifier.rb +++ b/activesupport/lib/active_support/message_verifier.rb @@ -41,8 +41,8 @@ module ActiveSupport if "foo".respond_to?(:force_encoding) # constant-time comparison algorithm to prevent timing attacks def secure_compare(a, b) - a = a.force_encoding(Encoding::BINARY) - b = b.force_encoding(Encoding::BINARY) + a = a.dup.force_encoding(Encoding::BINARY) + b = b.dup.force_encoding(Encoding::BINARY) if a.length == b.length result = 0 |