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

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 19 13:18:02 PST 2018


vitalybuka added inline comments.


================
Comment at: test/sanitizer_common/TestCases/NetBSD/strtonum.cc:13
+
+  l = strtonum("100", 1, 100, &errstr);
+  if (errstr)
----------------
what is going to happen with following?
strtonum("100 long suffix....", 0, 1000, &errstr)
if this stops parsing just after 100 then COMMON_INTERCEPTOR_READ_RANGE(ctx, nptr, REAL(strlen)(nptr) + 1)  is performance bottleneck
maybe we should get actual read size with StrtolFixAndCheck

we had issues with other strto* with strict_string_checks=1 on parsers like python
it just calls such methods in the middle of a large file and you get O(N) -> O(N^2)



Repository:
  rL LLVM

https://reviews.llvm.org/D54527





More information about the llvm-commits mailing list