Create bcheck region for argv and arge argument

For program manipulating argv or arge as pointer with construct such as:

(while *argv++) {
  do_something_with_argv;
}

it is necessary to have argv and arge inside a region. This patch create
regions argv and arge) if main is declared with those parameters.
This commit is contained in:
Thomas Preud'homme
2014-03-29 14:28:02 +08:00
parent 9a6ee577f6
commit b125743323
3 changed files with 23 additions and 0 deletions

View File

@ -418,6 +418,13 @@ void __bound_init(void)
}
}
void __bound_main_arg(void **p)
{
void *start = p;
while (*p++);
__bound_new_region(start, (void *) p - start);
}
void __bound_exit(void)
{
restore_malloc_hooks();