Re: [PATCH] config.c: fix writing config files on Windows network shares
- From
Jeff King <peff@peff.net>
- Date
- Jun 30, 2015, 16:01 UTC
- Message-ID
- <20150630160125.GB3953@peff.net>
- In-Reply-To
- <5592ABBC.60904@web.de>
On Tue, Jun 30, 2015 at 04:46:20PM +0200, Torsten Bögershausen wrote:
Show 8 quoted lines
> The value of fstat() is not checked here: > (indicated by a compiler warning, that contents_sz may be uninitalized. > > config.c: > int git_config_set_multivar_in_file( > //around line 2063 (the only call to fstat()) > fstat(in_fd, &st); > contents_sz = xsize_t(st.st_size);
There is a similar case in git_config_rename_section_in_file. It looks like they could both just jump to the error case when fstat() fails.
-Peff