Skip to content

Conversation

MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Aug 28, 2025

This model sadly isn't complete because our MaD parsing doesn't yet support using templates in the name of the function. This is necessary for stuff like:

template<Typename T>
class Foo {
  operator T();
};

which happens a lot for the ComPtrRef class (for example here). I plan to tackle that as a follow-up and then we can add the remaining models.

Commit-by-commit review recommended. I also spotted an incorrect model that I added in #20301 which I fixed in b4cc17f (and Copilot spotted even more stuff like that which I fixed in b9cd7a8). Generally, it's always a bug to have an occurrence of @ in the input column, but not in the output column (or vice versa) of a value-preserving summary since that would correspond to some kind of conflation.

@MathiasVP MathiasVP requested a review from a team as a code owner August 28, 2025 15:00
@Copilot Copilot AI review requested due to automatic review settings August 28, 2025 15:00
@github-actions github-actions bot added the C++ label Aug 28, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds conversion operators to the ComPtr model for Microsoft WRL (Windows Runtime Library) to improve data flow tracking. The models enable tracking of taint through ComPtr operations, which is important for security analysis of Windows C++ applications.

Key changes:

  • Adds new models for ComPtr assignment operators and dereference operators
  • Adds ComPtrRef class models for address-of operations
  • Improves taint flow detection through smart pointer conversions

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

File Description
ComPtr.model.yml Adds assignment operator models for ComPtr including templated and move assignment operators
ComPtrRef.model.yml New model file for ComPtrRef class with conversion and dereference operators
atl.cpp Adds test cases for new ComPtr operators and conversion scenarios
*.expected Test result updates reflecting the new models and improved taint flow detection

Copy link
Contributor

@jketema jketema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible. So I'm happy if DCA is happy.

@jketema
Copy link
Contributor

jketema commented Aug 29, 2025

DCA was uneventful.

@jketema jketema merged commit b361b0f into github:main Aug 29, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants