Skip to content

Commit

Permalink
decompileAction: Prevent heap buffer overflow and underflow with usin…
Browse files Browse the repository at this point in the history
…g OpCode
  • Loading branch information
Yoha-test authored and strk committed Jul 12, 2020
1 parent 6e76e8c commit da9d86e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions util/decompile.c
Original file line number Diff line number Diff line change
Expand Up @@ -3202,15 +3202,14 @@ decompileCAST(int n, SWF_ACTION *actions, int maxn)
int
decompileAction(int n, SWF_ACTION *actions, int maxn)
{
if( n > maxn ) SWF_error("Action overflow!!");

#ifdef DEBUG
fprintf(stderr,"%d:\tACTION[%3.3d]: %s\n",
actions[n].SWF_ACTIONRECORD.Offset, n,
actionName(actions[n].SWF_ACTIONRECORD.ActionCode));
#endif

switch(actions[n].SWF_ACTIONRECORD.ActionCode)
switch(OpCode(actions, n, maxn))
{
case SWFACTION_END:
return 0;
Expand Down

0 comments on commit da9d86e

Please sign in to comment.