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

Fix for CONC-762: Always set is_null and length in bind structure to avoid

msan errors
This commit is contained in:
Georg Richter
2025-03-31 11:02:35 +02:00
parent f7633e9d68
commit 28a1e4b599
2 changed files with 47 additions and 0 deletions

View File

@@ -414,6 +414,9 @@ int mthd_stmt_fetch_to_bind(MYSQL_STMT *stmt, unsigned char *row)
stmt->bind[i].is_null= &stmt->bind[i].is_null_value;
*stmt->bind[i].is_null= 1;
stmt->bind[i].u.row_ptr= NULL;
if (!stmt->bind[i].length)
stmt->bind[i].length= &stmt->bind[i].length_value;
*stmt->bind[i].length= stmt->bind[i].length_value= 0;
}
} else
{
@@ -426,6 +429,9 @@ int mthd_stmt_fetch_to_bind(MYSQL_STMT *stmt, unsigned char *row)
if (stmt->result_callback)
stmt->result_callback(stmt->user_data, i, &row);
else {
if (!stmt->bind[i].is_null)
stmt->bind[i].is_null= &stmt->bind[i].is_null_value;
*stmt->bind[i].is_null= 0;
if (mysql_ps_fetch_functions[stmt->fields[i].type].pack_len >= 0)
length= mysql_ps_fetch_functions[stmt->fields[i].type].pack_len;
else