File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
javascript/ql/src/Security/CWE-178 Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import javascript
1616 * Converts `s` to upper case, or to lower-case if it was already upper case.
1717 */
1818bindingset [ s]
19- string invertCase ( string s ) {
19+ string toOtherCase ( string s ) {
2020 if s .regexpMatch ( ".*[a-z].*" ) then result = s .toUpperCase ( ) else result = s .toLowerCase ( )
2121}
2222
@@ -35,7 +35,7 @@ predicate isCaseSensitiveRegExp(RegExpTerm term) {
3535 const = term .getAChild * ( ) and
3636 const .getValue ( ) .regexpMatch ( ".*[a-zA-Z].*" ) and
3737 not getEnclosingClass ( const ) .getAChild ( ) .( RegExpConstant ) .getValue ( ) =
38- invertCase ( const .getValue ( ) ) and
38+ toOtherCase ( const .getValue ( ) ) and
3939 not const .getParent * ( ) instanceof RegExpNegativeLookahead and
4040 not const .getParent * ( ) instanceof RegExpNegativeLookbehind
4141 )
@@ -67,7 +67,7 @@ string getExampleString(RegExpTerm term) {
6767string getCaseSensitiveBypassExample ( RegExpTerm term ) {
6868 exists ( string example |
6969 example = getExampleString ( term ) and
70- result = invertCase ( example ) and
70+ result = toOtherCase ( example ) and
7171 result != example // getting an example string is approximate; ensure we got a proper case-change example
7272 )
7373}
You can’t perform that action at this time.
0 commit comments