From: Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>
To: "Torsten Bögershausen" <tboegi@web•de>
Cc: drizzd@aon•at, git@vger•kernel.org
Subject: Re: [PATCH] unpack-trees.c: check return value of lstat()
Date: Sun, 06 Mar 2011 21:57:06 +0100 [thread overview]
Message-ID: <vpqpqq4ge71.fsf@bauges.imag.fr> (raw)
In-Reply-To: <4D73E577.1010604@web.de> ("Torsten Bögershausen"'s message of "Sun, 06 Mar 2011 20:50:15 +0100")
Torsten Bögershausen <tboegi@web•de> writes:
> On 06.03.11 20:29, Matthieu Moy wrote:
>> Torsten Bögershausen <tboegi@web•de> writes:
>>
>>> + if (!lstat(path, &st))
>>> + return check_ok_to_remove(path, len, DT_UNKNOWN, NULL, &st,
>>> + error_type, o);
>>> } else if (!lstat(ce->name, &st))
>>
>> What happens if lstat returns a non-0 value?
> The result of "st" is 100% garbage, and should not be passed to
> anybody.
With your code, you don't do a return, you'll reach the end of the
function without calling return, which is probably the worst thing you
could expect.
> v1.7.4 says:
> commit e39212ab08e8d37dda5d8fd32b54099fe01dbbdb
> Merge: 716958c 9e08273
You've cut the date:
commit e39212ab08e8d37dda5d8fd32b54099fe01dbbdb
Merge: 716958c 9e08273
Author: Junio C Hamano <gitster@pobox•com>
Date: Wed Dec 22 14:40:26 2010 -0800
=> no big surprise that you don't see the bugfix from Jan 12th.
>> Anyway, this seems to have been fixed by a93e53018 (Wed Jan 12 20:28:09
>> 2011, unpack-trees: handle lstat failure for existing file) already.
Did you look at the content of this commit?
> (And I had to correct drizzd@aon•a -> drizzd@aon•at)
Yes, because you've mis-spelled it in the first place and I didn't fix
it ;-).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
next prev parent reply other threads:[~2011-03-06 21:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-06 19:13 [PATCH] unpack-trees.c: check return value of lstat() Torsten Bögershausen
2011-03-06 19:29 ` Matthieu Moy
2011-03-06 19:50 ` Torsten Bögershausen
2011-03-06 20:57 ` Matthieu Moy [this message]
2011-03-07 15:59 ` Torsten Bögershausen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vpqpqq4ge71.fsf@bauges.imag.fr \
--to=matthieu.moy@grenoble-inp$(echo .)fr \
--cc=drizzd@aon$(echo .)at \
--cc=git@vger$(echo .)kernel.org \
--cc=tboegi@web$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox