Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When feeding a `char *` into `re->Match()`, it was converted to a StringPiece, taking its size as `strlen()`. For our (long) input, that wasn't resulting in the correct size, and did then freak out the re2 match input validation if the regular expression has an end anchor, but the endpos wasn't the same as its length. Since the endpos was taken from `s->len`, and the "length" taken via the mentioned StringPiece's strlen() call, they did indeed not match. Worked around by feeding it a properly-constructed std::string instead. I'm a C++ novice at best, but it does the trick, and I'm reasonable certain it's less wrong than before. Fixes open-policy-agent#6376. Signed-off-by: Stephan Renatus <[email protected]>
- Loading branch information