diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2023-10-17 06:33:05 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2023-10-17 06:33:05 -0400 |
commit | 117f07e5a4b7882a44681c730dcc0628238cfec6 (patch) | |
tree | 5cf60970252ad671fdd352062ae41950f318a82b /indra/newview/llpanellogin.cpp | |
parent | 19f453fc2007f780ae5d819090db206f07d0a9c6 (diff) |
SL-18837: Avoid stuffing build number into 32-bit int.
Even though LLVersionInfo::getBuild() already returns a 64-bit int, various
consumers assumed it could fit into 32 bits. It was especially bad to pass it
to a classic C style varargs function. Only on a little-endian CPU, and only
because it was the last argument, the damage was limited to truncation --
instead of arbitrary undefined behavior.
Where the consumer doesn't support 64-bit ints, pass as string instead.
Diffstat (limited to 'indra/newview/llpanellogin.cpp')
-rw-r--r-- | indra/newview/llpanellogin.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index ea936ab024..025a653c47 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -65,6 +65,7 @@ #include "lltrans.h" #include "llglheaders.h" #include "llpanelloginlistener.h" +#include "stringize.h" #if LL_WINDOWS #pragma warning(disable: 4355) // 'this' used in initializer list @@ -300,10 +301,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, setDefaultBtn(def_btn); std::string channel = LLVersionInfo::instance().getChannel(); - std::string version = llformat("%s (%ld)", - LLVersionInfo::instance().getShortVersion().c_str(), - LLVersionInfo::instance().getBuild()); - + std::string version = stringize(LLVersionInfo::instance().getShortVersion(), " (", + LLVersionInfo::instance().getBuild(), ')'); + LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text"); forgot_password_text->setClickedCallback(onClickForgotPassword, NULL); @@ -894,9 +894,8 @@ void LLPanelLogin::loadLoginPage() } // Channel and Version - params["version"] = llformat("%s (%ld)", - LLVersionInfo::instance().getShortVersion().c_str(), - LLVersionInfo::instance().getBuild()); + params["version"] = stringize(LLVersionInfo::instance().getShortVersion(), " (", + LLVersionInfo::instance().getBuild(), ')'); params["channel"] = LLVersionInfo::instance().getChannel(); // Grid |