diff options
-rwxr-xr-x | doc/contributions.txt | 4 | ||||
-rw-r--r-- | indra/newview/llconversationlog.cpp | 16 |
2 files changed, 13 insertions, 7 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt index c5d58cec9b..9340d69b97 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -264,10 +264,10 @@ Benja Kepler Benjamin Bigdipper Beq Janus BUG-227094 -Beth Walcher -Beq Janus SL-10288 SL-13583 + SL-14766 +Beth Walcher Bezilon Kasei Biancaluce Robbiani CT-225 diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 9d78c528b6..fd59dd2601 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -535,7 +535,9 @@ bool LLConversationLog::loadFromFile(const std::string& filename) } bool purge_required = false; - char buffer[MAX_STRING]; + static constexpr int UTF_BUFFER{ 1024 }; // long enough to handle the most extreme Unicode nonsense and some to spare + + char buffer[UTF_BUFFER]; char conv_name_buffer[MAX_STRING]; char part_id_buffer[MAX_STRING]; char conv_id_buffer[MAX_STRING]; @@ -546,11 +548,14 @@ bool LLConversationLog::loadFromFile(const std::string& filename) // before CHUI-348 it was a flag of conversation voice state int prereserved_unused; - while (!feof(fp) && fgets(buffer, MAX_STRING, fp)) + memset(buffer, '\0', UTF_BUFFER); + while (!feof(fp) && fgets(buffer, UTF_BUFFER, fp)) { - conv_name_buffer[0] = '\0'; - part_id_buffer[0] = '\0'; - conv_id_buffer[0] = '\0'; + // force blank for added safety + memset(conv_name_buffer, '\0', MAX_STRING); + memset(part_id_buffer, '\0', MAX_STRING); + memset(conv_id_buffer, '\0', MAX_STRING); + memset(history_file_name, '\0', MAX_STRING); sscanf(buffer, "[%lld] %d %d %d %[^|]| %s %s %[^|]|", &time, @@ -587,6 +592,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) } mConversations.push_back(conversation); + memset(buffer, '\0', UTF_BUFFER); } fclose(fp); |