Skip to content

Commit 0f4304c

Browse files
author
Brent Cook
committed
Land rapid7#5494, handle short reads from mysql
2 parents bb9439e + 15916f0 commit 0f4304c

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)