[PATCH] D59262: [scudo][standalone] Add string utility functions
Kostya Kortchinsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 12 11:35:29 PDT 2019
cryptoad marked an inline comment as done.
cryptoad added inline comments.
================
Comment at: lib/scudo/standalone/string_utils.cc:24
+
+uptr getStringLengthN(const char *S, uptr MaxLen) {
+ uptr I = 0;
----------------
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!
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