From ce6d30f361689a4e53d71b16855c3d94317e543f Mon Sep 17 00:00:00 2001 From: relesgoe <RElesgoe@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:31:31 -0800 Subject: [PATCH] Null-terminate BnetSRP3::username and BnetSRP3::password in BnetSRP3::init(). --- src/common/bnetsrp3.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/bnetsrp3.cpp b/src/common/bnetsrp3.cpp index c935c76..b22480b 100644 --- a/src/common/bnetsrp3.cpp +++ b/src/common/bnetsrp3.cpp @@ -81,6 +81,7 @@ namespace pvpgn { *(symbol++) = std::toupper(static_cast<unsigned char>(*(source++))); } + *(symbol++) = '\0'; if (!((password_ == NULL) ^ (salt_ == NULL))) { eventlog(eventlog_level_error, __FUNCTION__, "need to init with EITHER password_ OR salt_"); @@ -96,6 +97,7 @@ namespace pvpgn { *(symbol++) = std::toupper(static_cast<unsigned char>(*(source++))); } + *(symbol++) = '\0'; a = BigInt::random(32) % N; s = BigInt::random(32); }