bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with id when mgetgroups returns no groups.


From: scott . gnu . 2009
Subject: Re: Problem with id when mgetgroups returns no groups.
Date: Fri, 4 Dec 2009 14:12:29 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

On Fri, Dec 04, 2009 at 07:01:37AM -0700, Eric Blake wrote:
One failure case is indeed errno==ENOSYS.  (By the way, which system did
you find this on?)

Found on a custom embedded Linux server.

if mgetgroups doesn't find any groups, "groups" will not be changed and
therefore still contain an uninitialised value which is later freed on
the last line of this extract.  The fix we have here is to initialise
groups to NULL, then test before we free (although with glibc that isn't
actually necessary).

Actually, C requires that free(NULL) works, and gnulib guarantees that for
coreutils.  In fact, coreutils has a syntax check that rejects attempt to
check for NULL prior to calling free.

Sound good.

Thought you might like to know.

I'd like to push this as the fix.  However, it would be nicer to credit a
full name, rather than just "Scott", for listing you in THANKS.

Full name: Scott Harrison

Many thanks for the quick response,

Scott.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]