Skip to content

Commit e5f5d46

Browse files
addressing feedback from PR review
1 parent 39e53a2 commit e5f5d46

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

csharp/ql/src/experimental/Security Features/JsonWebTokenHandler/JsonWebTokenHandlerLib.qll

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -230,24 +230,14 @@ class CallableAlwaysReturnsParameter0 extends CallableReturnsStringAndArg0IsStri
230230
*/
231231
class CallableAlwaysReturnsParameter0MayThrowExceptions extends CallableReturnsStringAndArg0IsString {
232232
CallableAlwaysReturnsParameter0MayThrowExceptions() {
233-
callableOnlyThrowsArgumentNullException(this) and
234-
forall(ReturnStmt rs | rs.getEnclosingCallable() = this |
235-
rs.getChild(0) = this.getParameter(0).getAnAccess()
236-
) and
237-
exists(ReturnStmt rs | rs.getEnclosingCallable() = this)
233+
forex(Expr ret | this.canReturn(ret) |
234+
ret = this.getParameter(0).getAnAccess()
238235
or
239-
exists(
240-
AnonymousFunctionExpr le, Call call, CallableAlwaysReturnsParameter0MayThrowExceptions cat
241-
|
242-
this = le
243-
|
244-
call = le.getExpressionBody() and
245-
cat.getACall() = call and
246-
callableOnlyThrowsArgumentNullException(le) and
247-
callableOnlyThrowsArgumentNullException(cat)
236+
exists(CallableAlwaysReturnsParameter0MayThrowExceptions c |
237+
ret = c.getACall() and
238+
ret.(Call).getArgument(0) = this.getParameter(0).getAnAccess()
248239
)
249-
or
250-
this.getBody() = this.getParameter(0).getAnAccess()
240+
)
251241
}
252242
}
253243

0 commit comments

Comments
 (0)