Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de50aab commit c7ddd2cCopy full SHA for c7ddd2c
1 file changed
python/ql/src/semmle/python/regex.qll
@@ -128,7 +128,7 @@ abstract class RegexString extends Expr {
128
private predicate singleEscape(int i) {
129
exists(string c |
130
c = this.getChar(i) and
131
- c != "x" and c != "U"
+ c != "x" and c != "U" and c!= "N"
132
)
133
}
134
@@ -143,6 +143,16 @@ abstract class RegexString extends Expr {
143
or
144
this.getChar(start + 1) = "U" and end = start + 10
145
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
156
this.singleEscape(start + 1) and end = start + 2
157
158
0 commit comments