From: Thomas Schwinge Date: Sat, 28 Jul 2007 18:25:42 GMT Subject: Re: [PATCH] Don't rely on unspecified behavior Message-ID: <20070728182542.GA22651@fencepost.gnu.org> In-Reply-To: <20070728173948.GD23337@cip.informatik.uni-erlangen.de> Hello! On Sat, Jul 28, 2007 at 07:39:48PM +0200, Thomas Glanzmann wrote: > > Calling access(p, m) with p == NULL is not specified, so don't do > > that. On GNU/Hurd systems doing so will result in an SIGSEGV. > > a friend of mine choked on this one when tried git for the second time > (the first time "git-repack -a -d -f" screwed his repository after the > initial checkout. This is fixed for a long time). Lucky me that he had > his libusbdriver in LD_PRELOAD which could not handle the NULL argument. > And I always thought libc would make the check before it does the system > call or does GNU/hurts not use the gnu libc? GNU/Hurd systems do (obviously ;-) use the GNU libc. The glibc maintainer Roland McGrath explicitly told me that ``access (NULL, m)'' shall not be caught as it is not specified and thus must not be invoked like this. I noticed that the patch I sent was prepared for an old version of the file. I'll send an updated patch that applies to the current revision. Regards, Thomas