Skip to content

Commit 15916f0

Browse files
committed
Backport an upstream fix for a nil header
tmtm/ruby-mysql@353d595 tmtm/ruby-mysql@7c984ea
1 parent e151e38 commit 15916f0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/rbmysql/protocol.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ def read
234234
begin
235235
Timeout.timeout @read_timeout do
236236
header = @sock.read(4)
237+
raise EOFError unless header && header.length == 4
237238
len1, len2, seq = header.unpack("CvC")
238239
len = (len2 << 8) + len1
239240
# Ignore the sequence number -- protocol differences between 4.x and 5.x

0 commit comments

Comments
 (0)