1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-21 21:22:27 +03:00

Bug#25471090: MYSQL USE AFTER FREE

in a specially crafted invalid packet, one can get end_pos < pos here
This commit is contained in:
Sergei Golubchik
2018-04-19 22:39:24 +02:00
parent 149c993b2c
commit 7828ba0df4

View File

@ -1708,7 +1708,7 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
} }
else else
{ {
if (len > (ulong) (end_pos - pos)) if (pos + len > end_pos)
{ {
set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate); set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate);
return -1; return -1;