Skip to content

Commit

Permalink
Add bounds checking to GrowPlist
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Dec 20, 2017
1 parent 8b32bdc commit 394727c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plist.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ Int GrowPlist (
UInt plen; /* new physical length */
UInt good; /* good new physical length */

if (!UINT_FITS_IN_INTOBJ(need)) {
ErrorMayQuit("GrowPlist: List size too large", 0, 0);
}


/* find out how large the plain list should become */
good = 5 * (SIZE_OBJ(list)/sizeof(Obj)-1) / 4 + 4;

Expand Down

0 comments on commit 394727c

Please sign in to comment.