[PATCH] D59262: [scudo][standalone] Add string utility functions

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 12:36:41 PDT 2019


vitalybuka added inline comments.


================
Comment at: lib/scudo/standalone/string_utils.cc:24
+
+uptr getStringLengthN(const char *S, uptr MaxLen) {
+  uptr I = 0;
----------------
cryptoad wrote:
> vitalybuka wrote:
> > do you need internal implementation of these functions? Why can't you use libc?
> > I would expect that scudo has no the same restrictions as sanitizer_common
> With those, I am slightly worried about localization in the libc, and how strings might end up being processed, with possibly at some point heap allocations.
> Looking around it looks like strlen/strnlen/strcmp/strncmp are generally safe (glibc/bionic) but it's not an exhaustive assessment.
> strtol appears to be far more complicated.
> You likely know better about those intricacies, let me know what you think!
I would go with as little as possible of custom code.
Add them when you hit an issue?


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D59262





More information about the llvm-commits mailing list