We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b9daa2 commit 6e6921bCopy full SHA for 6e6921b
cpp/ql/src/experimental/Security/CWE/CWE-120/MemoryUnsafeFunctionScan.ql
@@ -15,9 +15,5 @@ import semmle.code.cpp.commons.Scanf
15
from FunctionCall call, ScanfFunction sff
16
where
17
call.getTarget() = sff and
18
- (
19
- call.getArgument(sff.getFormatParameterIndex()).toString().regexpMatch(".*%s.*")
20
- or
21
- call.getArgument(sff.getFormatParameterIndex()).toString() = (".*%ls.*")
22
- )
+ call.getArgument(sff.getFormatParameterIndex()).getValue().regexpMatch(".*%l?s.*")
23
select call, "Dangerous use of one of the scanf functions"
0 commit comments