Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++: Model Microsoft's "Active Template Library" #18136
C++: Model Microsoft's "Active Template Library" #18136
Changes from all commits
fe9feb9
16e5fa3
bf36f00
f688470
749602c
763b991
2c7d0de
c00f84d
4f2cd81
1cd426e
0f8df1c
c604a93
2b8ef5a
68ee8da
9b00484
948be09
e831cb5
5f05417
1a79290
3543619
c61395b
029c013
02b88d5
12674ea
74b6c9d
1ea879a
300e3ea
e73fccd
dee47f2
74eae4a
ac0599c
3709151
67ba85a
33212da
5aada39
d69de0c
19e7c37
0242874
3c0af49
2c58279
0c8245f
593e223
3abb904
c3086d4
8d035e6
de75e03
9dc3aec
c7dee4b
279a30c
4f00e22
d0bf3b8
904db38
f7b55e0
6388a9a
66de42c
3d0a205
59f4b3c
d735a14
d3dc318
db86f6a
674dbce
7f87a25
184dfc2
5f33733
8bdd10c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
HANDLE
is a pointer, so this could beArgument[*0]
. See https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types .I don't actually feel strongly about how we model this though, we could probably continue to treat them as opaque values if you prefer. It is important that we stay consistent in future models that mention
HANDLE
(e.g.CAtlFileMappingBase.GetHandle
andCAtlFileMappingBase.MapFile
) and aliases such asHKEY
(used inCRegKey
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I wanted to treat
HANDLE
s are opaque values and not really depend on them being pointers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like there are potentially some queries we could develop or extend into the area of memory mapped files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's going on here? I mean, what is
.Field[*m_psa].Field[*@pvData]
and why do we sometimes reference it instead of just.Field[*m_psa]
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
m_psa
field is a public member ofCComSafeArray
: https://learn.microsoft.com/en-us/cpp/atl/reference/ccomsafearray-class?view=msvc-170#m_psa. So it's possible to do:So in order to capture this flow we model the effect of calling
Add
by making it a write to them_psa->pvData
member.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel we should also model
CRegKey::Create
, which I believe is commonly used when adding new data structures in the registry. ThelpszKeyName
(Argument[*1]
) should have taint flow into the qualifier.(it could also be a query sink, you would not want untrusted data controlling this operation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I've added this summary model in 674dbce. I think this is one that could also be treated with
MapKey
flow at some point and be made value-preserving.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it will be value preserving as you're still appending the key name to an existing registry path represented by the current state of the key. Unless maybe you consider the key to be a set of path edges, in which case I suppose you're adding one value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that was my thinking. But I guess we can settle on those details later. I agree that there are multiple ways to think of this.