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