Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sql/proxy_protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ int parse_proxy_protocol_header(NET *net, proxy_peer_info *peer_info)
if (have_v1_header)
{
/* Read until end of header (newline character)*/
while(pos < sizeof(hdr))
while(pos < sizeof(hdr) - 1)
{
long len= (long)vio_read(vio, hdr + pos, 1);
if (len < 0)
if (len <= 0)
return -1;
pos++;
if (hdr[pos-1] == '\n')
Expand Down