From 5c539792104eefd2f2e2770cd8280206667c3d4d Mon Sep 17 00:00:00 2001 From: Philip Ginsbach Date: Fri, 2 Dec 2022 11:54:08 +0000 Subject: [PATCH] fix QL match-string pattern --- cpp/ql/src/JPL_C/LOC-4/Rule 20/PreprocessorUsePartial.ql | 2 +- cpp/ql/src/Power of 10/Rule 8/PartialMacro.ql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/ql/src/JPL_C/LOC-4/Rule 20/PreprocessorUsePartial.ql b/cpp/ql/src/JPL_C/LOC-4/Rule 20/PreprocessorUsePartial.ql index eed90414eb3..376f50962d6 100644 --- a/cpp/ql/src/JPL_C/LOC-4/Rule 20/PreprocessorUsePartial.ql +++ b/cpp/ql/src/JPL_C/LOC-4/Rule 20/PreprocessorUsePartial.ql @@ -12,7 +12,7 @@ import cpp predicate incomplete(Macro m) { - exists(string body | body = m.getBody() and not m.getBody().matches("%\\") | + exists(string body | body = m.getBody() and not m.getBody().matches("%\\\\") | body.regexpMatch("[^(]*\\).*") or body.regexpMatch("[^\\[]*].*") or body.regexpMatch("[^{]*}.*") or diff --git a/cpp/ql/src/Power of 10/Rule 8/PartialMacro.ql b/cpp/ql/src/Power of 10/Rule 8/PartialMacro.ql index 2598118805c..7abc0b2f669 100644 --- a/cpp/ql/src/Power of 10/Rule 8/PartialMacro.ql +++ b/cpp/ql/src/Power of 10/Rule 8/PartialMacro.ql @@ -12,7 +12,7 @@ import cpp predicate incomplete(Macro m) { - exists(string body | body = m.getBody() and not m.getBody().matches("%\\") | + exists(string body | body = m.getBody() and not m.getBody().matches("%\\\\") | body.regexpMatch("[^(]*\\).*") or body.regexpMatch("[^\\[]*].*") or body.regexpMatch("[^{]*}.*") or