-
Notifications
You must be signed in to change notification settings - Fork 141
mingw: avoid a buffer overrun in needs_hiding()
#427
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
Conversation
When this function is passed a path with a trailing slash, it runs right over the end of that path. Let's fix this. Co-authored-by: Alexandr Miloslavskiy <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
/submit |
cc @SyntevoAlex |
Submitted as [email protected] |
This branch is now known as |
This patch series was integrated into pu via git@a617569. |
This patch series was integrated into next via git@d412109. |
This patch series was integrated into pu via git@d617a36. |
This patch series was integrated into pu via git@f2db52c. |
This patch series was integrated into next via git@f2db52c. |
This patch series was integrated into master via git@f2db52c. |
Closed via f2db52c. |
On Unix, files are hidden from the output of
ls
by default when their names start with a.
. On Windows, there is an explicit flag that you need to set.It is quite uncommon, though, to hide all of the "dot files" on Windows, which is why Git hides only
.git
by default, and it has a setting to override this default (core.hideDotFiles
).The code to determine whether that flag needs to be set for a given file had a buffer overrun, though, if the path that was passed into the function ended with a directory separator. This patch fixes this.
The original contribution by Alex is over at #414, and I worked with him to evolve it into the current version.
Cc: Alexandr Miloslavskiy [email protected]