Re: [PATCH] Add NULL checks for getugroups grouplist argument

Paul Eggert <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs
Organization UCLA Computer Science Department
Message-ID <[email protected]>
On 2026-08-19 08:24, Sergey Zhidkih wrote:
> So if this is the case, then there's no need for explicit NULL check
> for grouplist. This inconsistency creates questions which are detected
> by static analyzers.

The other option would be adding _GL_ATTRIBUTE_NONNULL_IF_NONZERO to the header declaring getugroups. Not sure I see the use case for a null pointer and a nonzero count.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.