Re: [hackers] [sbase] [PATCH 1/2] [libutil/recurse] only opendir if recursing

From: David Phillips <david_AT_sighup.nz>
Date: Sun, 1 Oct 2017 21:25:37 +1300

On Sun, Oct 01, 2017 at 12:35:23AM -0700, Michael Forney wrote:
> Hi David,
>
> Thanks for the patch. The general idea seems good to me.
>

Thanks!

>
> I don't understand the `!r->maxdepth` check here. If `r->depth + 1 <
> r->maxdepth` is used to enter the outer branch, won't an uninitialized
> `dp` to be passed to readdir?
>

Hmmm… neither do I. The only thing that condition could guard against is
`r->depth < -1`, which is nonsensical. You're definitely right about the
uninitialised `dp` being passed to readdir too.

Looks like I accidentally sent the wrong version of the patch (the version
crafted late night/early morning), especially judging by the broken English
in my commit message. I'll send the updated patch in a wee bit.

Thanks,
David
Received on Sun Oct 01 2017 - 10:25:37 CEST

This archive was generated by hypermail 2.3.0 : Sun Oct 01 2017 - 10:36:21 CEST