glibc _FORTIFY_SOURCE=2 and %n in writable segment detected

Dean Takemori deant at
Tue Apr 27 03:30:04 PDT 2010

> From: "Gilles Espinasse" <g.esp at>
> Message-ID: <026401cae482$5587e050$f9b5a8c0 at pii350>
> Content-Type: text/plain;	charset="iso-8859-1"

> Now the question is :
> is it required to support %n in writable memory to support %n format?
> If gnulib emulate that system call because test has failed, will the
> emulation be better, worst or the same than original from glibc?
> Gilles

It appears from some quick code perusal that the failure or success 
of that test has no effect on gzip-1.4 as long as the glibc is 
reasonably new.

- lib/config.h has no NEED_PRINTF_DIRECTIVE_N
- the code lib/vasnprintf.c codes around it.

I have not checked any other packages, but I'm guessing that as long 
as the project used a fairly recent gnulib/libiberty that %n might 
not be a big issue.

-dean takemori

More information about the hlfs-dev mailing list