mirror of
https://github.com/github/codeql.git
synced 2026-04-21 15:05:56 +02:00
C++: Add a MaD model for 'CAtlFile' and mark reads as local flow sources.
This commit is contained in:
@@ -53,3 +53,4 @@ private import implementations.Win32CommandExecution
|
||||
private import implementations.CA2AEX
|
||||
private import implementations.CComBSTR
|
||||
private import implementations.CPathT
|
||||
private import implementations.CAtlFile
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import semmle.code.cpp.models.interfaces.FlowSource
|
||||
|
||||
/**
|
||||
* The `CAtlFile` class from Microsoft's Active Template Library.
|
||||
*/
|
||||
class CAtlFile extends Class {
|
||||
CAtlFile() { this.hasGlobalName("CAtlFile") }
|
||||
}
|
||||
|
||||
private class CAtlFileRead extends MemberFunction, LocalFlowSourceFunction {
|
||||
CAtlFileRead() { this.getClassAndName("Read") instanceof CAtlFile }
|
||||
|
||||
override predicate hasLocalFlowSource(FunctionOutput output, string description) {
|
||||
output.isParameterDeref(0) and
|
||||
description = "string read by " + this.getName()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user