Skip to content

Commit b52a2cd

Browse files
Apply code review comments
Co-authored-by: Anders Schack-Mulligen <[email protected]>
1 parent d0b9920 commit b52a2cd

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

java/ql/lib/semmle/code/java/security/CleartextStorageCookieQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ private class CookieCleartextStorageSink extends CleartextStorageSink {
1212
/** The instantiation of a cookie, which can act as storage. */
1313
class Cookie extends Storable, ClassInstanceExpr {
1414
Cookie() {
15-
this.getConstructor().getDeclaringType().getQualifiedName() = "javax.servlet.http.Cookie"
15+
this.getConstructor().getDeclaringType().hasQualifiedName("javax.servlet.http", "Cookie")
1616
}
1717

1818
/** Gets an input, for example `input` in `new Cookie("...", input);`. */
@@ -31,7 +31,7 @@ private predicate cookieStore(DataFlow::Node cookie, Expr store) {
3131
exists(MethodAccess m, Method def |
3232
m.getMethod() = def and
3333
def.getName() = "addCookie" and
34-
def.getDeclaringType().getQualifiedName() = "javax.servlet.http.HttpServletResponse" and
34+
def.getDeclaringType().hasQualifiedName("javax.servlet.http", "HttpServletResponse") and
3535
store = m and
3636
cookie.asExpr() = m.getAnArgument()
3737
)

java/ql/lib/semmle/code/java/security/CleartextStorageQuery.qll

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ class CleartextStorageAdditionalTaintStep extends Unit {
1717
}
1818

1919
/** Class for expressions that may represent 'sensitive' information */
20-
class SensitiveSource extends Expr {
21-
SensitiveSource() {
22-
// SensitiveExpr is abstract, this lets us inherit from it without
23-
// being a technical subclass
24-
this instanceof SensitiveExpr
25-
}
26-
20+
class SensitiveSource extends Expr instanceof SensitiveExpr {
2721
/** Holds if this source flows to the `sink`. */
2822
predicate flowsTo(Expr sink) {
2923
exists(SensitiveSourceFlowConfig conf |

0 commit comments

Comments
 (0)