Summary: Security: There is no range checking in `StringPiece`, `span`, and other custom containers (was: Security: There is no range checking in `StringPiece`)
Unrestricting; this is regular ol' feature work now. Also, it's relatively easy and makes a good first bug for an open source contributor or intern: just search for classes that have `operator[]`, add `CHECK`s, and see if perf bots get angry.
Re comment #12, there is sadly quite a lot of code which depends on base::StringPiece's iterators being const char*, by way of base::CStringTokenizer, because the normal base::StringTokenizer only works on std::string::const_iterator.
Over in issue #820198, I'm trying to chew through a lot of the base::StringTokenizer bits, but it's all rather tightly intertwined with everything. The trouble is while going from std::string::const_iterator pairs to base::StringPiece works, the other direction does not.
+gabimelchior, who has offered to help out. Thanks!
Another thing we'll want to do for this bug is to add negative unit tests, like death tests, to make sure the safety guarantees don't decay.
Comment 1 by bugdroid1@chromium.org
, Mar 3 2018