Skip to content

Commit

Permalink
Merge pull request #995 from qw-ctf/overflow
Browse files Browse the repository at this point in the history
CONSOLE: Fix buffer overflow.
  • Loading branch information
dsvensson authored Jan 12, 2025
2 parents 6173de7 + 2b18083 commit 730edc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,9 +997,9 @@ void Con_DrawConsole (int lines) {

i = strlen (dlbar);
if (cls.download)
snprintf (dlbar + i, sizeof (dlbar), " %02d%%(%dkb/s)", cls.downloadpercent, cls.downloadrate);
snprintf (dlbar + i, sizeof (dlbar) - i, " %02d%%(%dkb/s)", cls.downloadpercent, cls.downloadrate);
else if (cls.upload)
snprintf (dlbar + i, sizeof (dlbar), " %02d%%(%dkb/s)", cls.uploadpercent, cls.uploadrate);
snprintf (dlbar + i, sizeof (dlbar) - i, " %02d%%(%dkb/s)", cls.uploadpercent, cls.uploadrate);
else
return;

Expand Down

0 comments on commit 730edc1

Please sign in to comment.