-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Clean up some code in ANCM #49718
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
Clean up some code in ANCM #49718
Conversation
} | ||
else if (struPath.QueryStr()[dwPosition-1] == L':') | ||
|
||
if (struPath.QueryStr()[position - 1] == L':') |
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.
You removed the position == 0
condition so this one can buffer underrun now
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 removed it because it can never be 0. Can it? Even in the case where we start at 0, the STRU::IndexOf is given the start offset of position+1 to search from, and it will either return -1 (if not found) or a position >=1.
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.
Oh, I guess. Probably add a comment then since it wasn't obvious from first glance
HRESULT | ||
FILE_UTILITY::EnsureDirectoryPathExist( | ||
_In_ LPCWSTR pszPath | ||
FILE_UTILITY::EnsureDirectoryPathExists( |
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.
Need to change the header and caller
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.
Yea, I used the VS refactor thing and forgot to save the other modified files 😆
Cleaning up some stuff I noticed while I was looking into ANCM code. This includes some dead code removal, fixing weird conditionals, removing some gotos, etc.
This is pure cleanup and should have no functional impact.
cc: @BrennanConroy