Blame SOURCES/mariadb-string-overflow.patch

4b4994
These issues were found by Coverity static analysis tool, for more info
4b4994
see messages by particular fixes (messages belong to 5.1.61).
4b4994
4b4994
Filed upstream at http://bugs.mysql.com/bug.php?id=64631
4b4994
4b4994
4b4994
Error: BUFFER_SIZE_WARNING:
4b4994
/builddir/build/BUILD/mysql-5.1.61/sql/sql_prepare.cc:2749: buffer_size_warning: Calling strncpy with a maximum size argument of 512 bytes on destination array "this->stmt->last_error" of size 512 bytes might leave the destination string unterminated.
4b4994
4b4994
4b4994
diff -up mariadb-10.0.10/sql/sql_prepare.cc.p8 mariadb-10.0.10/sql/sql_prepare.cc
4b4994
--- mariadb-10.0.10/sql/sql_prepare.cc.p8	2014-03-30 19:56:42.000000000 +0200
4b4994
+++ mariadb-10.0.10/sql/sql_prepare.cc	2014-04-07 18:43:33.901074770 +0200
4b4994
@@ -3277,7 +3277,7 @@ void mysql_stmt_get_longdata(THD *thd, c
4b4994
   {
4b4994
     stmt->state= Query_arena::STMT_ERROR;
4b4994
     stmt->last_errno= thd->get_stmt_da()->sql_errno();
4b4994
-    strncpy(stmt->last_error, thd->get_stmt_da()->message(), MYSQL_ERRMSG_SIZE);
4b4994
+    strncpy(stmt->last_error, thd->get_stmt_da()->message(), sizeof(stmt->last_error)-1);
4b4994
   }
4b4994
   thd->set_stmt_da(save_stmt_da);
4b4994