From ef5f54bbf3ab41980d9cf3be273257927a6a6cbb Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Wed, 21 Oct 2026 22:32:09 -0400 Subject: #6322 Fix nulls in clipboard truncating string --- indra/llui/llclipboard.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 64896ccfcb..0483da001f 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -132,6 +132,11 @@ bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool us LL_WARNS() << "Can't add the substring to clipboard: " << e.what() << LL_ENDL; return false; } + + // Clipboards cannot contain NULL characters, so remove them first so they + // do not truncate the string. + mString.erase(std::remove(mString.begin(), mString.end(), 0), mString.end()); + return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); } -- cgit v1.3