Skip to content

Commit

Permalink
Fix radareorg#2850 - oob read with the command /p
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarofe committed Jun 28, 2015
1 parent beaf9c7 commit 8a4792e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions libr/core/cmd_search.c
Original file line number Diff line number Diff line change
Expand Up @@ -1754,13 +1754,17 @@ static int cmd_search(void *data, const char *input) {
break;
case 'p': // "/p"
{
int ps = atoi (input+param_offset);
if (ps>1) {
r_cons_break (NULL, NULL);
r_search_pattern_size (core->search, ps);
r_search_pattern (core->search, param.from, param.to);
r_cons_break_end ();
} else eprintf ("Invalid pattern size (must be >0)\n");
if (input[param_offset-1]) {
int ps = atoi (input+param_offset);
if (ps>1) {
r_cons_break (NULL, NULL);
r_search_pattern_size (core->search, ps);
r_search_pattern (core->search, param.from, param.to);
r_cons_break_end ();
break;
}
}
eprintf ("Invalid pattern size (must be >0)\n");
}
break;
case 'V':
Expand Down

0 comments on commit 8a4792e

Please sign in to comment.