git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>,
	Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 0/1] mingw: avoid a buffer overrun in needs_hiding()
Date: Fri, 25 Oct 2019 14:13:35 +0000	[thread overview]
Message-ID: <pull.427.git.1572012816.gitgitgadget@gmail.com> (raw)

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 
https://github.com/gitgitgadget/git/pull/414, and I worked with him to
evolve it into the current version.

Cc: Alexandr Miloslavskiy alexandr.miloslavskiy@syntevo.com
[alexandr.miloslavskiy@syntevo.com]

Johannes Schindelin (1):
  mingw: avoid a buffer overrun in `needs_hiding()`

 compat/mingw.c | 2 ++
 1 file changed, 2 insertions(+)


base-commit: 566a1439f6f56c2171b8853ddbca0ad3f5098770
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-427%2Fdscho%2Ffix-needs-hiding-buffer-overrun-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-427/dscho/fix-needs-hiding-buffer-overrun-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/427
-- 
gitgitgadget

             reply	other threads:[~2019-10-25 14:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25 14:13 Johannes Schindelin via GitGitGadget [this message]
2019-10-25 14:13 ` [PATCH 1/1] mingw: avoid a buffer overrun in `needs_hiding()` Johannes Schindelin via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.427.git.1572012816.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).