[llvm-commits] [ASan] add full strtoll implementation and interceptor (issue 5876052)
kcc at google.com
Thu Mar 22 09:15:11 PDT 2012
I support the intention but I don't like the approach.
You effectively reimplemented strtoll, which may appear to be even more
complex function than it looks.
Now we suddenly need to have an exhaustive test for this part of libc,
including messy errno business.
Meanwhile, why can't you use the original strtoll from libc?
it gives you the endptr which could be used by asan run-time to detect the
right bound of access.
Also, instead of ifndef(_WIN32) I would prefer more meaningful guards like
#ifdef(ASAN_CAN_USE_STRTOLL), defined in one place.
On Thu, Mar 22, 2012 at 5:17 AM, <samsonov at google.com> wrote:
> Reviewers: Evgeniy Stepanov, kcc1, timurrrr_at_google_com,
> We need to intercept strtol/atoi functions - calling them may result in
> OOB reads (and they appear in stack traces of Chromium crash reports).
> Looks like we have to re-implement them. Here's the major step to do
> Please review this at http://codereview.appspot.com/**5876052/<http://codereview.appspot.com/5876052/>
> Affected files:
> M asan_interceptors.cc
> M asan_interceptors.h
> M asan_internal.h
> M asan_posix.cc
> M asan_rtl.cc
> M asan_win.cc
> M tests/asan_test.cc
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits