Merge pull request #10586 from erik-krogh/pyRegFix

ReDoS: fix RegExpEscape::getValue having multiple results for some escapes
This commit is contained in:
Erik Krogh Kristensen
2022-09-27 14:41:18 +02:00
committed by GitHub
4 changed files with 13 additions and 4 deletions

View File

@@ -468,7 +468,9 @@ class RegExpEscape extends RegExpNormalChar {
* TODO: Handle named escapes.
*/
override string getValue() {
this.isIdentityEscape() and result = this.getUnescaped()
not this.isUnicode() and
this.isIdentityEscape() and
result = this.getUnescaped()
or
this.getUnescaped() = "n" and result = "\n"
or