[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:45:28 PST 2018
vitalybuka added inline comments.
================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7742
}
- return ret;
+
+ saved_errno = errno;
----------------
```
INTERCEPTOR(long long, strtonum, const char *nptr, long long minval,
long long maxval, const char **errstr) {
void *ctx;
COMMON_INTERCEPTOR_ENTER(ctx, strtonum, nptr, minval, maxval, errstr);
char *real_endptr;
long long ret = REAL(strtoll)(nptr, &real_endptr, 10);
StrtolFixAndCheck(ctx, nptr, nullptr, real_endptr, 10);
ret = REAL(strtonum)(nptr, minval, maxval, errstr);
if (errstr) {
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, errstr, sizeof(const char *));
if (*errstr)
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *errstr, REAL(strlen)(*errstr) + 1);
}
return ret;
}
```
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