"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: gotwebd: error path leak & semplification for render_index
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 9 Nov 2022 15:48:47 +0100

Download raw body.

Thread
On Wed, Nov 09, 2022 at 03:27:52PM +0100, Omar Polo wrote:
> -		    strcmp(sd_dent[d_i]->d_name, "..") == 0)
> +		    strcmp(sd_dent[d_i]->d_name, "..") == 0 ||
> +		    sd_dent[d_i]->d_type != DT_DIR) {

Unfortunately, we cannot rely on d_type directly. It is unreliable
because it depends on the filesystem implementation.
See got_path_dirent_type() in lib/path.c for a workaround.