From 233269869c3fbef8334ff7c47033ef80eed9d37e Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Thu, 4 Nov 2021 16:26:14 +0000 Subject: [PATCH] Tidy sanitizers, using `instanceof` not `extends` or a charpred where possible --- ql/src/experimental/CWE-918/SSRF.qll | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ql/src/experimental/CWE-918/SSRF.qll b/ql/src/experimental/CWE-918/SSRF.qll index ee34f86754f..4d1d0ebe2cb 100644 --- a/ql/src/experimental/CWE-918/SSRF.qll +++ b/ql/src/experimental/CWE-918/SSRF.qll @@ -152,17 +152,13 @@ module ServerSideRequestForgery { * the binding function to run some validations for that field. If these binding functions returns * no error, then we consider these fields safe for SSRF. */ - class BodySanitizer extends Sanitizer { - BodySanitizer() { this instanceof CheckedAlphanumericStructFieldRead } - } + class BodySanitizer extends Sanitizer instanceof CheckedAlphanumericStructFieldRead { } /** * The method Var of package validator is a sanitizer guard only if the check * of the error binding exists, and the tag to check is one of "alpha", "alphanum", "alphaunicode", "alphanumunicode", "number", "numeric". */ - class ValidatorAsSanitizer extends SanitizerGuard { - ValidatorAsSanitizer() { this instanceof ValidatorVarCheck } - + class ValidatorAsSanitizer extends SanitizerGuard instanceof ValidatorVarCheck { override predicate checks(Expr e, boolean branch) { this.checks(e, branch) } } }