Skip to content

Commit

Permalink
Make mysql parser more tolerant.
Browse files Browse the repository at this point in the history
  • Loading branch information
Barenboim committed Aug 26, 2023
1 parent 1eb668c commit 17b81b9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/protocol/mysql_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,15 @@ static int parse_ok_packet(const void *buf, size_t len, mysql_parser_t *parser)
if (decode_string(&str, &info_len, &p, buf_end) == 0)
return -2;

if (server_status & MYSQL_SERVER_SESSION_STATE_CHANGED)
if (p != buf_end)
{
const unsigned char *tmp_str;
unsigned long long tmp_len;
if (decode_string(&tmp_str, &tmp_len, &p, buf_end) == 0)
if (server_status & MYSQL_SERVER_SESSION_STATE_CHANGED)
{
const unsigned char *tmp_str;
unsigned long long tmp_len;
if (decode_string(&tmp_str, &tmp_len, &p, buf_end) == 0)
return -2;
} else
return -2;
}
} else {
Expand Down

0 comments on commit 17b81b9

Please sign in to comment.