Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mingw: avoid a buffer overrun in needs_hiding()#427

Closed
dscho wants to merge 1 commit intogitgitgadget:mastergitgitgadget/git:masterfrom
dscho:fix-needs-hiding-buffer-overrundscho/git:fix-needs-hiding-buffer-overrunCopy head branch name to clipboard
Closed

mingw: avoid a buffer overrun in needs_hiding()#427
dscho wants to merge 1 commit intogitgitgadget:mastergitgitgadget/git:masterfrom
dscho:fix-needs-hiding-buffer-overrundscho/git:fix-needs-hiding-buffer-overrunCopy head branch name to clipboard

Conversation

@dscho
Copy link
Member

@dscho dscho commented Oct 25, 2019

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 alexandr.miloslavskiy@syntevo.com

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 <alexandr.miloslavskiy@syntevo.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member Author

dscho commented Oct 25, 2019

/submit

@dscho
Copy link
Member Author

dscho commented Oct 25, 2019

cc @SyntevoAlex

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 25, 2019

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 28, 2019

This branch is now known as js/mingw-needs-hiding-fix.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 28, 2019

This patch series was integrated into pu via git@a617569.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 28, 2019

This patch series was integrated into next via git@d412109.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 29, 2019

This patch series was integrated into pu via git@d617a36.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 30, 2019

This patch series was integrated into pu via git@f2db52c.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 30, 2019

This patch series was integrated into next via git@f2db52c.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 30, 2019

This patch series was integrated into master via git@f2db52c.

@gitgitgadget gitgitgadget bot added the master label Oct 30, 2019
@gitgitgadget gitgitgadget bot closed this Oct 30, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Oct 30, 2019

Closed via f2db52c.

@dscho dscho deleted the fix-needs-hiding-buffer-overrun branch October 30, 2019 14:12
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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.