From b125743323f92b3492634cd875be820c890d5f29 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Sat, 29 Mar 2014 14:28:02 +0800 Subject: 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. --- lib/bcheck.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/bcheck.c b/lib/bcheck.c index 064fb5d..968cdf4 100644 --- a/lib/bcheck.c +++ b/lib/bcheck.c @@ -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(); -- cgit v1.3.1