Skip to content

Commit

Permalink
Fix #740: fix out-of-bound reads when handling type sizes
Browse files Browse the repository at this point in the history
Loading progs.dat that uses FTE extensions types causes undefined behavior when saving games or printing edicts to console
  • Loading branch information
alexey-lysiuk authored and vsonnier committed Oct 24, 2024
1 parent 5967f14 commit 72026f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Quake/pr_edict.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,9 @@ void ED_Write (FILE *f, edict_t *ed)
if (type & DEF_SAVEGLOBAL)
continue;

if (type >= NUM_TYPE_SIZES)
continue;

name = PR_GetString (d->s_name);
j = strlen (name);
if (j > 1 && name[j - 2] == '_')
Expand Down

0 comments on commit 72026f9

Please sign in to comment.