1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-7019 String::chop() is wrong and may potentially crash (MySQL bug#56492)

Merging a fix from the upstream.
This commit is contained in:
Alexander Barkov
2014-11-10 18:08:17 +04:00
parent 2da6f7ceba
commit b84a892fb2

View File

@ -232,7 +232,9 @@ public:
*/
inline void chop()
{
Ptr[str_length--]= '\0';
str_length--;
Ptr[str_length]= '\0';
DBUG_ASSERT(strlen(Ptr) == str_length);
}
inline void free()