Project

General

Profile

Actions

Bug #11910

closed

resolv.rb - can't modify frozen String in #scan

Added by henry.helper (Henry Helper) about 8 years ago. Updated about 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:72559]

Description

lib/resolv.rb contains "frozen_string_literal: true". This causes an error in a travis build from https://github.com/middleman/middleman/pull/1713.

/home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/resolv.rb:2462:in `block in create': can't modify frozen String (RuntimeError)
from /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/resolv.rb:2462:in `scan'
from /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/resolv.rb:2462:in `create'
from /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/resolv.rb:462:in `each_name'

The code in line lib/resolv.rb#L2462 (https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L2462) causes the error. It modifies a string.

prefix.scan(/[0-9A-Fa-f]+/) {|hex| a1 << [hex.hex].pack('n')}

Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Bug #12061: DNS resolv error RuntimeError: can't modify frozen String when using IPv6 AddressesClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0