Project

General

Profile

« Previous | Next » 

Revision eb531313

Added by hanazuki (Kasumi Hanazuki) almost 2 years ago

[ruby/ipaddr] ntop: Measure address size in bytes

IPAddr.ntop takes the binary representation of an IP address, whose
length should be 4 or 16 bytes (not characters/codepoints).

The current implementation accepts strings in any encoding, but for
some values in non-BINARY encoding, it fails proper length check and
raises an AddressFamilyError. Since passing strings in a multibyte
encoding has never worked correctly for years, this patch makes it an
explicit error with an InvalidAddressError.

Fixes: https://github.com/ruby/ipaddr/issues/56

https://github.com/ruby/ipaddr/commit/a33fd14d4a