Re: What's cooking in git.git (Dec 2019, #04; Tue, 17)
- From
Elijah Newren <newren@gmail.com>
- Date
- Dec 18, 2019, 17:15 UTC
- Message-ID
- <CABPp-BGRjewgHtFQ7F_isrqnC25EQyWoPbpdyVJeDzfVEysiCg@mail.gmail.com>
- In-Reply-To
- <xmqqa77qfw99.fsf@gitster-ct.c.googlers.com>
On Tue, Dec 17, 2019 at 2:03 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> * 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).
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.
I'll submit a re-roll with those two things fixed.