Skip to content

Commit 6e6921b

Browse files
author
dilanbhalla
committed
implemented pr fixes
1 parent 3b9daa2 commit 6e6921b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-120/MemoryUnsafeFunctionScan.ql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,5 @@ import semmle.code.cpp.commons.Scanf
1515
from FunctionCall call, ScanfFunction sff
1616
where
1717
call.getTarget() = sff and
18-
(
19-
call.getArgument(sff.getFormatParameterIndex()).toString().regexpMatch(".*%s.*")
20-
or
21-
call.getArgument(sff.getFormatParameterIndex()).toString() = (".*%ls.*")
22-
)
18+
call.getArgument(sff.getFormatParameterIndex()).getValue().regexpMatch(".*%l?s.*")
2319
select call, "Dangerous use of one of the scanf functions"

0 commit comments

Comments
 (0)