I support the intention but I don't like the approach. <div>You effectively reimplemented strtoll, which may appear to be even more complex function than it looks. </div><div>Now we suddenly need to have an exhaustive test for this part of libc, including messy errno business. </div>
<div>Meanwhile, why can't you use the original strtoll from libc? </div><div>it gives you the endptr which could be used by asan run-time to detect the right bound of access.</div><div><br></div><div>Also, instead of ifndef(_WIN32) I would prefer more meaningful guards like #ifdef(ASAN_CAN_USE_STRTOLL), defined in one place.</div>
<div><br></div><div>--kcc <br><br><div class="gmail_quote">On Thu, Mar 22, 2012 at 5:17 AM,  <span dir="ltr"><<a href="mailto:samsonov@google.com">samsonov@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Reviewers: Evgeniy Stepanov, kcc1, timurrrr_at_google_com,<br>
<br>
Message:<br>
We need to intercept strtol/atoi functions - calling them may result in<br>
OOB reads (and they appear in stack traces of Chromium crash reports).<br>
Looks like we have to re-implement them. Here's the major step to do<br>
this.<br>
<br>
<br>
<br>
Please review this at <a href="http://codereview.appspot.com/5876052/" target="_blank">http://codereview.appspot.com/<u></u>5876052/</a><br>
<br>
Affected files:<br>
  M     asan_interceptors.cc<br>
  M     asan_interceptors.h<br>
  M     asan_internal.h<br>
  M     asan_posix.cc<br>
  M     asan_rtl.cc<br>
  M     asan_win.cc<br>
  M     tests/asan_test.cc<br>
<br>
<br>
</blockquote></div><br></div>