public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/17829] New: Incorrect handling of precision specifier in printf family
@ 2015-01-12  4:32 nfxjfg at googlemail dot com
  2015-01-12  4:33 ` [Bug libc/17829] " nfxjfg at googlemail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: nfxjfg at googlemail dot com @ 2015-01-12  4:32 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17829

            Bug ID: 17829
           Summary: Incorrect handling of precision specifier in printf
                    family
           Product: glibc
           Version: 2.19
            Status: NEW
          Severity: critical
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: nfxjfg at googlemail dot com
                CC: drepper.fsp at gmail dot com

The following program shows no output:

#include <stdio.h>
#include <limits.h>

int main(int argc, char **argv)
{
    printf("%.*s\n", INT_MAX, "hi");
    return 0;
}

The precision given is INT_MAX; this should turn the precision specifier into a
no-OP, equivalent to 'printf("%s\n", "hi");'. Making the precision value
somewhat lower seems to make it work.

snprintf() seems to have a similar issue, but the failure seems to start with
even lower precision values.

Other libcs handle this correctly (I tested mingw-w64 and musl).

Using glibc 2.19-13 on Debian 32 bit x86.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-08-30 11:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-12  4:32 [Bug libc/17829] New: Incorrect handling of precision specifier in printf family nfxjfg at googlemail dot com
2015-01-12  4:33 ` [Bug libc/17829] " nfxjfg at googlemail dot com
2015-01-12 17:52 ` [Bug stdio/17829] " jsm28 at gcc dot gnu.org
2015-01-29 13:00 ` fweimer at redhat dot com
2015-02-18 14:27 ` fweimer at redhat dot com
2015-02-18 14:33 ` carlos at redhat dot com
2015-02-18 17:26 ` nfxjfg at googlemail dot com
2020-07-07 14:54 ` cvs-commit at gcc dot gnu.org
2022-08-30  8:23 ` cvs-commit at gcc dot gnu.org
2022-08-30  8:45 ` cvs-commit at gcc dot gnu.org
2022-08-30  9:20 ` cvs-commit at gcc dot gnu.org
2022-08-30 11:07 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).