Skip to content

Commit 988c1bc

Browse files
authored
Merge pull request github#5026 from MathiasVP/remove-linear-scan-of-functions
C++: Remove linear scan of functions table
2 parents 39977e9 + 3604557 commit 988c1bc

File tree

1 file changed

+1
-3
lines changed
  • cpp/ql/src/semmle/code/cpp/models/implementations

1 file changed

+1
-3
lines changed

cpp/ql/src/semmle/code/cpp/models/implementations/Strcpy.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ class StrcpyFunction extends ArrayFunction, DataFlowFunction, TaintFunction, Sid
4040
/**
4141
* Holds if this is one of the `strcpy_s` variants.
4242
*/
43-
private predicate isSVariant() {
44-
exists(string name | name = getName() | name.suffix(name.length() - 2) = "_s")
45-
}
43+
private predicate isSVariant() { getName().matches("%\\_s") }
4644

4745
/**
4846
* Gets the index of the parameter that is the maximum size of the copy (in characters).

0 commit comments

Comments
 (0)