1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Fix length calculation

When calculating the length of buffer for prepared statement
executiong a maximum length of 5 for length encoded types was
used. This should be 9, since length encoded types starting
with 0xFE are followed by length of 8 bytes.
This commit is contained in:
Georg Richter
2021-09-27 13:27:40 +02:00
parent 4b9379b2aa
commit 410d64d8de

View File

@@ -805,7 +805,7 @@ unsigned char* mysql_stmt_execute_generate_simple_request(MYSQL_STMT *stmt, size
case MYSQL_TYPE_ENUM:
case MYSQL_TYPE_BIT:
case MYSQL_TYPE_SET:
size+= 5; /* max 8 bytes for size */
size+= 9; /* max 8 bytes for size */
size+= (size_t)ma_get_length(stmt, i, 0);
break;
default: