diff --git a/lib/postgres/postgres-pr/message.rb b/lib/postgres/postgres-pr/message.rb index 643b688cdd..cb45a6724c 100644 --- a/lib/postgres/postgres-pr/message.rb +++ b/lib/postgres/postgres-pr/message.rb @@ -44,7 +44,7 @@ class Message def self.read(stream, startup=false) type = stream.read_exactly_n_bytes(1) unless startup - length = stream.read_exactly_n_bytes(4).unpack('N').first # FIXME: length should be signed, not unsigned + length = stream.read_exactly_n_bytes(4).to_s.unpack('N').first # FIXME: length should be signed, not unsigned raise ParseError unless length >= 4