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 @@ -124,6 +124,14 @@ abstract class RegexString extends Expr {
124
124
)
125
125
}
126
126
127
+ // escaped characters without any special handling (yet)
128
+ private predicate singleEscape ( int i ) {
129
+ exists ( string c |
130
+ c = this .getChar ( i ) and
131
+ c != "x" and c != "U"
132
+ )
133
+ }
134
+
127
135
private predicate escapedCharacter ( int start , int end ) {
128
136
this .escapingChar ( start ) and
129
137
not exists ( this .getText ( ) .substring ( start + 1 , end + 1 ) .toInt ( ) ) and
@@ -133,7 +141,9 @@ abstract class RegexString extends Expr {
133
141
end in [ start + 2 .. start + 4 ] and
134
142
exists ( this .getText ( ) .substring ( start + 1 , end ) .toInt ( ) )
135
143
or
136
- this .getChar ( start + 1 ) != "x" and end = start + 2
144
+ this .getChar ( start + 1 ) = "U" and end = start + 10
145
+ or
146
+ this .singleEscape ( start + 1 ) and end = start + 2
137
147
)
138
148
}
139
149
You can’t perform that action at this time.
0 commit comments