File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
python/ql/src/semmle/python Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ abstract class RegexString extends Expr {
128128 private predicate singleEscape ( int i ) {
129129 exists ( string c |
130130 c = this .getChar ( i ) and
131- c != "x" and c != "U"
131+ c != "x" and c != "U" and c != "N"
132132 )
133133 }
134134
@@ -143,6 +143,16 @@ abstract class RegexString extends Expr {
143143 or
144144 this .getChar ( start + 1 ) = "U" and end = start + 10
145145 or
146+ this .getChar ( start + 1 ) = "N" and
147+ this .getChar ( start + 2 ) = "{" and
148+ this .getChar ( end - 1 ) = "}" and
149+ end > start and
150+ not exists ( int i |
151+ i > start + 2 and
152+ i < end - 1 and
153+ this .getChar ( i ) = "}"
154+ )
155+ or
146156 this .singleEscape ( start + 1 ) and end = start + 2
147157 )
148158 }
You can’t perform that action at this time.
0 commit comments