diff options
author | unknown <konstantin@mysql.com> | 2005-05-14 02:31:26 +0400 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2005-05-14 02:31:26 +0400 |
commit | ba3540cc6991c49e0f43501e600018896b5e0dcb (patch) | |
tree | 987f77e9bab99e7956ae1e87ff9f7dd0e421882c /libmysql/libmysql.c | |
parent | 752372f62626321f60563c6c825424801b5a7f60 (diff) | |
download | mariadb-git-ba3540cc6991c49e0f43501e600018896b5e0dcb.tar.gz |
Fix a valgrind warning: memcpy does not allow its arguments to overlap.
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r-- | libmysql/libmysql.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 4c9f06df38e..3fcdc6bdc4d 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3944,9 +3944,12 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind) /* We only need to check that stmt->field_count - if it is not null stmt->bind was initialized in mysql_stmt_prepare - */ + stmt->bind overlaps with bind if mysql_stmt_bind_param + is called from mysql_stmt_store_result. + */ - memcpy((char*) stmt->bind, (char*) bind, sizeof(MYSQL_BIND) * bind_count); + if (stmt->bind != bind) + memcpy((char*) stmt->bind, (char*) bind, sizeof(MYSQL_BIND) * bind_count); for (param= stmt->bind, end= param + bind_count, field= stmt->fields ; param < end ; |