diff options
author | konstantin@mysql.com <> | 2005-05-14 02:31:26 +0400 |
---|---|---|
committer | konstantin@mysql.com <> | 2005-05-14 02:31:26 +0400 |
commit | 6c981c0b8005a1577c7dfd93eb656a5da46ef9f0 (patch) | |
tree | 987f77e9bab99e7956ae1e87ff9f7dd0e421882c /libmysql/libmysql.c | |
parent | 6adfd9436ebfa0274f9fd5c4402e8d4e1d467f52 (diff) | |
download | mariadb-git-6c981c0b8005a1577c7dfd93eb656a5da46ef9f0.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 ; |