Skip to content

Commit

Permalink
Merge pull request #1356 from Barenboim/master
Browse files Browse the repository at this point in the history
Fix mysql parser.
  • Loading branch information
Barenboim authored Aug 17, 2023
2 parents 0caa115 + 5131d07 commit 3d8b3a8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/protocol/mysql_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,21 @@ static int parse_ok_packet(const void *buf, size_t len, mysql_parser_t *parser)
{
const unsigned char *tmp_str;
unsigned long long tmp_len;

if (decode_string(&str, &info_len, &p, buf_end) == 0)
return -2;

if (decode_string(&tmp_str, &tmp_len, &p, buf_end) == 0)
return -2;

} else if (p != buf_end &&
*p != MYSQL_PACKET_HEADER_OK &&
*p != MYSQL_PACKET_HEADER_NULL &&
*p != MYSQL_PACKET_HEADER_EOF &&
*p != MYSQL_PACKET_HEADER_ERROR)
{
if (decode_string(&str, &info_len, &p, buf_end) == 0)
return -2;
} else {
str = p;
info_len = 0;
Expand Down

0 comments on commit 3d8b3a8

Please sign in to comment.