ronin-rb / ronin-support

A support library for Ronin. Like activesupport, but for hacking!
https://ronin-rb.dev
GNU Lesser General Public License v3.0
26 stars 9 forks source link

`Network::Support::IP#ipv4_mapped` raises `can't modify frozen NilClass: nil` error #453

Closed postmodern closed 1 year ago

postmodern commented 1 year ago

For some reason Network::Support::IP#ipv4_mapped causes an exception when called on an IPv4 address IP object. This is likely due to the fact Network::Support::IP inherits from IPAddr.

Steps To Reproduce

ip = Ronin::Support::Network::IP.new('127.0.0.1')
ip.ipv4_mapped

Expected Results

#<Ronin::Support::Network::IP: 0000:0000:0000:0000:0000:ffff:7f00:0001>

Actual Results

/opt/rubies/ruby-3.1.4/lib/ruby/3.1.0/ipaddr.rb:323:in `instance_variable_set': can't modify frozen NilClass: nil (FrozenError)
    from /opt/rubies/ruby-3.1.4/lib/ruby/3.1.0/ipaddr.rb:323:in `ipv4_mapped'