Fix logic bugs I introduced with my last fix

This commit is contained in:
gwillcox-r7 2020-08-04 16:20:49 -05:00
parent be4d5d90bb
commit a92ffe4486
No known key found for this signature in database
GPG Key ID: D35E05C0F2B81E83
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ class Message
type = stream.read_exactly_n_bytes(1) unless startup
length = stream.read_exactly_n_bytes(4).to_s.unpack('N').first # FIXME: length should be signed, not unsigned
raise ParseError if (!length.nil? || length >= 4)
raise ParseError if (length.nil? || length < 4)
# If we didn't read any bytes and startup was not set, then type will be nil, so don't continue.
unless startup