From 84a61d1e0224eb140fbd64d9880e12d3734bcfa4 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 9 Mar 2023 15:36:26 +0000 Subject: [PATCH] C++: No need for 'matches'. --- cpp/ql/src/Security/CWE/CWE-313/CleartextSqliteDatabase.ql | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cpp/ql/src/Security/CWE/CWE-313/CleartextSqliteDatabase.ql b/cpp/ql/src/Security/CWE/CWE-313/CleartextSqliteDatabase.ql index c37da4e2697..90df5226465 100644 --- a/cpp/ql/src/Security/CWE/CWE-313/CleartextSqliteDatabase.ql +++ b/cpp/ql/src/Security/CWE/CWE-313/CleartextSqliteDatabase.ql @@ -34,7 +34,7 @@ class SqliteFunctionExecCall extends SqliteFunctionCall { class SqliteFunctionAppendfCall extends SqliteFunctionCall { SqliteFunctionAppendfCall() { - this.getTarget().getName().matches(["sqlite3_str_appendf", "sqlite3_str_vappendf"]) + this.getTarget().hasName(["sqlite3_str_appendf", "sqlite3_str_vappendf"]) } override Expr getASource() { result = this.getArgument(any(int n | n > 0)) } @@ -42,7 +42,7 @@ class SqliteFunctionAppendfCall extends SqliteFunctionCall { class SqliteFunctionAppendNonCharCall extends SqliteFunctionCall { SqliteFunctionAppendNonCharCall() { - this.getTarget().getName().matches(["sqlite3_str_append", "sqlite3_str_appendall"]) + this.getTarget().hasName(["sqlite3_str_append", "sqlite3_str_appendall"]) } override Expr getASource() { result = this.getArgument(1) } @@ -57,8 +57,7 @@ class SqliteFunctionAppendCharCall extends SqliteFunctionCall { class SqliteFunctionBindCall extends SqliteFunctionCall { SqliteFunctionBindCall() { this.getTarget() - .getName() - .matches([ + .hasName([ "sqlite3_bind_blob", "sqlite3_bind_blob64", "sqlite3_bind_text", "sqlite3_bind_text16", "sqlite3_bind_text64", "sqlite3_bind_value", "sqlite3_bind_pointer" ])