Skip to content

Commit 7df9b75

Browse files
authored
Fix potential UB in GetLatencyMessage using static (#56)
1 parent cc2d226 commit 7df9b75

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Spawner/ProtocolZero.LatencyLevel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void LatencyLevel::Apply(LatencyLevelEnum newLatencyLevel)
5757

5858
int LatencyLevel::GetMaxAhead(LatencyLevelEnum latencyLevel)
5959
{
60-
const int maxAhead[] =
60+
static const int maxAhead[] =
6161
{
6262
/* 0 */ 1
6363

@@ -77,7 +77,7 @@ int LatencyLevel::GetMaxAhead(LatencyLevelEnum latencyLevel)
7777

7878
const wchar_t* LatencyLevel::GetLatencyMessage(LatencyLevelEnum latencyLevel)
7979
{
80-
const wchar_t* message[] =
80+
static const wchar_t* message[] =
8181
{
8282
/* 0 */ L"CnCNet: Latency mode set to: 0 - Initial" // Players should never see this, if it doesn't then it's a bug
8383

0 commit comments

Comments
 (0)