Skip to content

Conversation

dscho
Copy link
Member

@dscho dscho commented Oct 25, 2019

Inspired by gitgitgadget#414, this is a minimal fix for the issue that needs_hiding() runs right outside the buffer when being passed a path with a trailing slash.

The patch in gitgitgadget#414 does too many things: it not only fixes the bug, but rewrites a large part of the function. This late in the -rc phase leading up to v2.24.0, I am not willing to risk such a rewrite.

Cc: @SyntevoAlex

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]>
@dscho dscho force-pushed the fix-needs-hiding-buffer-overrun branch from 52301de to 0b6a19e Compare October 25, 2019 13:18
@dscho dscho merged commit 631336f into git-for-windows:master Oct 25, 2019
@dscho dscho deleted the fix-needs-hiding-buffer-overrun branch October 25, 2019 13:20
@dscho dscho added this to the v2.23.0(2) milestone Oct 25, 2019
dscho added a commit that referenced this pull request Oct 25, 2019
Avoid a buffer overrun in `needs_hiding()`
dscho added a commit to git-for-windows/build-extra that referenced this pull request Oct 25, 2019
A buffer overrun in the code to determine
which files need to be marked as hidden [was
plugged](git-for-windows/git#2371).

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this pull request Oct 25, 2019
Avoid a buffer overrun in `needs_hiding()`
dscho added a commit that referenced this pull request Oct 25, 2019
Avoid a buffer overrun in `needs_hiding()`
dscho added a commit that referenced this pull request Oct 25, 2019
Avoid a buffer overrun in `needs_hiding()`
dscho added a commit that referenced this pull request Oct 30, 2019
Avoid a buffer overrun in `needs_hiding()`
dscho added a commit that referenced this pull request Nov 2, 2019
Avoid a buffer overrun in `needs_hiding()`
@dscho dscho mentioned this pull request Nov 4, 2019
dscho added a commit that referenced this pull request Nov 6, 2019
Avoid a buffer overrun in `needs_hiding()`
dscho added a commit that referenced this pull request Nov 16, 2019
Avoid a buffer overrun in `needs_hiding()`
dscho added a commit that referenced this pull request Nov 25, 2019
Avoid a buffer overrun in `needs_hiding()`
dscho added a commit that referenced this pull request Nov 26, 2019
Avoid a buffer overrun in `needs_hiding()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant