git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: What's cooking in git.git (Dec 2019, #04; Tue, 17)
Date: Wed, 18 Dec 2019 10:01:28 -0800	[thread overview]
Message-ID: <xmqqsglhecnb.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CABPp-BGRjewgHtFQ7F_isrqnC25EQyWoPbpdyVJeDzfVEysiCg@mail.gmail.com> (Elijah Newren's message of "Wed, 18 Dec 2019 09:15:35 -0800")

Elijah Newren <newren@gmail.com> writes:

> On Tue, Dec 17, 2019 at 2:03 PM Junio C Hamano <gitster@pobox.com> wrote:
>
>> * en/fill-directory-fixes (2019-12-11) 8 commits
>>  - dir: consolidate similar code in treat_directory()
>>  - dir: synchronize treat_leading_path() and read_directory_recursive()
>>  - dir: fix checks on common prefix directory
>>  - dir: break part of read_directory_recursive() out for reuse
>>  - dir: exit before wildcard fall-through if there is no wildcard
>>  - dir: remove stray quote character in comment
>>  - Revert "dir.c: make 'git-status --ignored' work within leading directories"
>>  - t3011: demonstrate directory traversal failures
>>
>>  Assorted fixes to the directory traversal API.
>>
>>  Will merge to 'next'.
>
> Please hold; even if you are willing to accept a manufactured dirent,
> the discussion did highlight two bugs in this series:
>
> 1) I shouldn't assume dirent has a d_type member; my one access to it
> should be guarded with a !defined(NO_D_TYPE_IN_DIRENT).

Thanks, yes, that should be done.

>
> 2) I should allocate my dirent on the heap (with some extra buffer
> space) rather than the stack, because if dirent has a "char d_name[]"
> rather than a "char d_name[BIG_ENOUGH]" declaration, then my
> stack-based allocation followed by writing to d_name will smash the
> stack.

Yes, or BIG_ENOUGH may not be long enough for the name you are
creating.

> I'll submit a re-roll with those two things fixed.

Thanks.

  reply	other threads:[~2019-12-18 18:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 22:00 What's cooking in git.git (Dec 2019, #04; Tue, 17) Junio C Hamano
2019-12-18 17:15 ` Elijah Newren
2019-12-18 18:01   ` Junio C Hamano [this message]
2019-12-18 19:33 ` Elijah Newren
2019-12-18 22:40   ` Junio C Hamano
2019-12-19 14:56 ` Pratyush Yadav

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=xmqqsglhecnb.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    /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).