From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74351 invoked by alias); 24 Jul 2015 14:44:16 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 74291 invoked by uid 48); 24 Jul 2015 14:44:12 -0000 From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/18641] pwd.h: add __nonnull markings Date: Fri, 24 Jul 2015 14:44:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: vapier at gentoo dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: cc flagtypes.name Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg00183.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18641 Florian Weimer changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fweimer at redhat dot com Flags| |security- --- Comment #3 from Florian Weimer --- (In reply to Mike Frysinger from comment #0) > per the thread: > https://sourceware.org/ml/libc-alpha/2015-05/msg00867.html > > when you use many functions in pwd.h with NULL pointers, glibc will crash. > POSIX doesn't require NULL to be supported, so we want to mark all the funcs > as nonnull instead. this way user code is compiled with warnings and our > API expectations are documented. I couldn't find this discussed on the mailing list. putpwent at least is documented as returning EINVAL for NULL arguments in its manual page: EINVAL Invalid (NULL) argument given. And the code has checks for that. Future GCC versions may rewrite the NULL check to an abort because of the nonnull attribute with just -O2 optimization. I am not convinced this is what we want. -- You are receiving this mail because: You are on the CC list for the bug.