mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Add the constraint that the caller method must throw an exception
This commit is contained in:
@@ -48,9 +48,10 @@ class UncaughtServletExceptionSink extends DataFlow::ExprNode {
|
||||
UncaughtServletExceptionSink() {
|
||||
exists(Method m, MethodAccess ma | ma.getMethod() = m |
|
||||
isServletMethod(ma.getEnclosingCallable()) and
|
||||
exists(m.getAThrownExceptionType()) and // The called method might plausibly throw an exception.
|
||||
ma.getAnArgument() = this.getExpr() and
|
||||
not exists(TryStmt t |
|
||||
t.getBlock() = ma.getEnclosingStmt().getEnclosingStmt*() and
|
||||
t.getBlock() = ma.getAnEnclosingStmt() and
|
||||
exceptionIsCaught(t, m.getAThrownExceptionType())
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user