Fix Android logging signature in java/ql/src/experimental/semmle/code/java/Logging.qll

This commit is contained in:
Daniel Santos
2021-09-16 11:24:06 -05:00
parent a67db45454
commit af8b2b6d9c

View File

@@ -18,8 +18,7 @@ class LoggingCall extends MethodAccess {
t.hasQualifiedName("org.scijava.log", "Logger") or
t.hasQualifiedName("com.google.common.flogger", "LoggingApi") or
t.hasQualifiedName("java.lang", "System$Logger") or
t.hasQualifiedName("java.util.logging", "Logger") or
t.hasQualifiedName("android.util", "Log")
t.hasQualifiedName("java.util.logging", "Logger")
|
(
m.getDeclaringType().getASourceSupertype*() = t or
@@ -28,6 +27,23 @@ class LoggingCall extends MethodAccess {
m.getReturnType() instanceof VoidType and
this = m.getAReference()
)
or
exists(RefType t, Method m | t.hasQualifiedName("android.util", "Log") |
(
m.hasName("d") or
m.hasName("e") or
m.hasName("i") or
m.hasName("v") or
m.hasName("w") or
m.hasName("wtf")
) and
(
m.getDeclaringType().getASourceSupertype*() = t or
m.getDeclaringType().extendsOrImplements*(t)
) and
m.getReturnType() instanceof IntegralType and
this = m.getAReference()
)
}
/** Returns an argument which would be logged by this call. */