From 8dab067c01ec29540648d015c04cc74c297402ab Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 11 Aug 2020 17:23:44 +0300 Subject: [PATCH] Add missing NULL termination to the String::repeat function. --- core/ustring.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/ustring.cpp b/core/ustring.cpp index 8bb490064f8..3df30e096d6 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3071,6 +3071,7 @@ String String::repeat(int p_count) const { const CharType *src = this->c_str(); new_string.resize(length() * p_count + 1); + new_string[length() * p_count] = 0; for (int i = 0; i < p_count; i++) for (int j = 0; j < length(); j++)