Skip to content

Commit

Permalink
Fix format string vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
samisalreadytaken committed Oct 23, 2021
1 parent 5fa7648 commit b2c0ab4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sp/src/game/client/vgui_debugoverlaypanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void CDebugOverlay::Paint()
{
float xPos = screenPos[0];
float yPos = screenPos[1]+ (pCurrText->lineOffset*13); // Line spacing;
g_pMatSystemSurface->DrawColoredText( m_hFont, xPos, yPos, r, g, b, a, pCurrText->text );
g_pMatSystemSurface->DrawColoredText( m_hFont, xPos, yPos, r, g, b, a, "%s", pCurrText->text );
}
}
else
Expand All @@ -138,7 +138,7 @@ void CDebugOverlay::Paint()
{
float xPos = screenPos[0];
float yPos = screenPos[1]+ (pCurrText->lineOffset*13); // Line spacing;
g_pMatSystemSurface->DrawColoredText( m_hFont, xPos, yPos, r, g, b, a, pCurrText->text );
g_pMatSystemSurface->DrawColoredText( m_hFont, xPos, yPos, r, g, b, a, "%s", pCurrText->text );
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions sp/src/game/shared/mapbase/vscript_funcs_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ bool ScriptIsClient()
// Notification printing on the right edge of the screen
void NPrint( int pos, const char* fmt )
{
engine->Con_NPrintf(pos, fmt);
engine->Con_NPrintf( pos, "%s", fmt );
}

void NXPrint( int pos, int r, int g, int b, bool fixed, float ftime, const char* fmt )
Expand All @@ -922,7 +922,7 @@ void NXPrint( int pos, int r, int g, int b, bool fixed, float ftime, const char*
info.color[2] = b / 255.f;
info.fixed_width_font = fixed;

engine->Con_NXPrintf( &info, fmt );
engine->Con_NXPrintf( &info, "%s", fmt );
}

static float IntervalPerTick()
Expand Down

0 comments on commit b2c0ab4

Please sign in to comment.