Fix out of band read in argument check for af+

This commit is contained in:
Fangrui Song 2017-08-18 06:05:47 -07:00 committed by radare
parent f8d5ba8d3d
commit 92de0ceaf6
2 changed files with 6 additions and 3 deletions

View File

@ -216,7 +216,7 @@ R_API bool core_anal_bbs(RCore *core, const char* input) {
Sdb *sdb = NULL;
ut64 cur = 0;
ut64 start = core->offset;
ut64 size = r_num_math (core->num, input + 1);
ut64 size = input[0] ? r_num_math (core->num, input + 1) : core->blocksize;
ut64 b_start = start;
RAnalOp *op;
RListIter *iter;

View File

@ -1894,8 +1894,11 @@ static int cmd_anal_fcn(RCore *core, const char *input) {
}
}
break;
case '+': // "af+"
{
case '+': { // "af+"
if (input[2] != ' ') {
eprintf ("Missing arguments\n");
return false;
}
char *ptr = strdup (input + 3);
const char *ptr2;
int n = r_str_word_set0 (ptr);