From e8db563e98e0cde70fee2c17070dd50312c03d44 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 27 Jan 2023 10:04:48 +0000 Subject: [PATCH] C++: Reformulate the sanitizer in 'NonConstantFormat.ql'. It should no longer incorrectly sanitize indirect nodes for which there is no result for 'asIndirectExpr'. --- cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql b/cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql index ffb85602a30..050ea9db4d9 100644 --- a/cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql +++ b/cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql @@ -120,8 +120,7 @@ pragma[noinline] predicate isSanitizerNode(DataFlow::Node node) { underscoreMacro(node.asExpr()) or - not exists(node.asIndirectExpr()) and - not exists(node.asDefiningArgument()) and + exists(node.asExpr()) and cannotContainString(node.getType(), false) }