tech-userlevel archive

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

Re: pam_krb5.c - -Werror=format-overflow



On Thu, Feb 6, 2020 at 5:11 AM Martin Husemann <martin%duskware.de@localhost> wrote:
>
> On Thu, Feb 06, 2020 at 05:01:55AM -0500, Santhosh Raju wrote:
> > --- dependall-pam_krb5 ---
> > /home/fox/projects/netbsd/obj-wip/destdir.amd64/usr/include/security/pam_modules.h:
> > In function 'pam_sm_setcred':
> > /home/fox/projects/netbsd/src-wip/lib/libpam/modules/pam_krb5/pam_krb5.c:489:6:
> > error: null destination pointer [-Werror=format-overflow=]
> >       sprintf(p, "%d", getpid());
> >       ^~~~~~~~~~~~~~~~~~~~~~~~~~
> > /home/fox/projects/netbsd/src-wip/lib/libpam/modules/pam_krb5/pam_krb5.c:485:6:
> > error: null destination pointer [-Werror=format-overflow=]
> >       sprintf(p, "%d", pwd->pw_uid);
> >       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> The diagnostic obviously is totally stupid and should be ignored.
> The Makefile tries to do so for clang already:
>
> CWARNFLAGS.clang=       -Wno-format-security
>
> Instead of modifying the (innocent) source you should extend this for
> gcc flags instead.
>

I did notice the -Wno-format-security, is it same as format-overflow?
I am more than happy to add the flag and ignore the warning from gcc
if it is stupid :)

> The host gcc is totally irrelevant here, as this is compiled by the in-tree
> cross gcc. So why is it breaking for you but works on the build cluster?
>

The build was done with MKLIBCSANITIZER=yes as a part of the sanitizer efforts.

I am guessing the build cluster does not run with MKLIBCSANITIZER=yes
in the build.sh?

>
> Martin

--
Santhosh


Home | Main Index | Thread Index | Old Index