mariadb/SOURCES/mariadb-covscan-stroverflow.patch
2018-08-16 08:49:30 -04:00

17 lines
851 B
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

The following problems have been found by Coverity - static analysis tool.
mysql-5.5.31/sql/sp_rcontext.h:87:buffer_size_warning Calling strncpy with a maximum size argument of 512 bytes on destination array "this->m_message" of size 512 bytes might leave the destination string unterminated.
diff -rup mariadb-5.5.47.covscan-stroverflow/sql/sp_rcontext.h mariadb-5.5.47/sql/sp_rcontext.h
--- mariadb-5.5.47.covscan-stroverflow/sql/sp_rcontext.h 2015-12-09 18:22:47.000000000 +0100
+++ mariadb-5.5.47/sql/sp_rcontext.h 2016-02-04 07:55:50.073558349 +0100
@@ -84,7 +84,8 @@ public:
memcpy(m_sql_state, sqlstate, SQLSTATE_LENGTH);
m_sql_state[SQLSTATE_LENGTH]= '\0';
- strncpy(m_message, msg, MYSQL_ERRMSG_SIZE);
+ strncpy(m_message, msg, sizeof(m_message)-1);
+ m_message[sizeof(m_message)-1] = '\0';
}
void clear()