Commit b84a892f authored by Alexander Barkov's avatar Alexander Barkov

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

Merging a fix from the upstream.
parent 2da6f7ce
...@@ -232,7 +232,9 @@ public: ...@@ -232,7 +232,9 @@ public:
*/ */
inline void chop() inline void chop()
{ {
Ptr[str_length--]= '\0'; str_length--;
Ptr[str_length]= '\0';
DBUG_ASSERT(strlen(Ptr) == str_length);
} }
inline void free() inline void free()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment