From 410d64d8de174095bf22f938c37a80c3ed310adb Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Mon, 27 Sep 2021 13:27:40 +0200 Subject: [PATCH] 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. --- libmariadb/mariadb_stmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmariadb/mariadb_stmt.c b/libmariadb/mariadb_stmt.c index ee1c3eb1..ef6fce85 100644 --- a/libmariadb/mariadb_stmt.c +++ b/libmariadb/mariadb_stmt.c @@ -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: