[PATCH] D54527: Add new interceptor for strtonum(3)

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 6 12:58:46 PST 2018


vitalybuka added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7728
 #if SANITIZER_INTERCEPT_STRTONUM
 INTERCEPTOR(long long, strtonum, const char *nptr, long long minval,
             long long maxval, const char **errstr) {
----------------
vitalybuka wrote:
> Patch says that base already has SANITIZER_INTERCEPT_STRTONUM
> but master has non of it
Phabricator does something weird:
Base vs Diff 1 : it's a new interceptor
Base vs Diff 2 : it's modified interceptor

I guess I was confused by this, I assumed that you are changing interceptor, not adding new one.
So in Diff 1 I don't like REAL(strlen). So  I proposed to use something to get actual read len and use StrtolFixAndCheck.

I think it's better to just to call parsing twice (line in snippets I've sent), instead of exposing error handling into interceptor, like in Diff 2.


However  I am not sure what is going to happen on BSD when we call REAL(strtonum). Is this going to hit strtoll interceptor, which is unfortunately not in common yet?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54527/new/

https://reviews.llvm.org/D54527





More information about the llvm-commits mailing list