Skip to content

Commit

Permalink
Fix potential stack overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Sep 25, 2015
1 parent 92fee0f commit d522a89
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libyara/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ int _yr_scan_fast_hex_re_exec(
//
// The opcode following the ANY is located at ip + 4

if (sp >= MAX_FAST_HEX_RE_STACK)
return -4;

code_stack[sp] = ip + 4;
input_stack[sp] = current_input;
matches_stack[sp] = matches;
Expand Down

0 comments on commit d522a89

Please sign in to comment.