From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20282 invoked by alias); 12 Jan 2015 04:32:58 -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 20215 invoked by uid 48); 12 Jan 2015 04:32:50 -0000 From: "nfxjfg at googlemail dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/17829] New: Incorrect handling of precision specifier in printf family Date: Mon, 12 Jan 2015 04:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.19 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: nfxjfg at googlemail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc Message-ID: 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-01/txt/msg00089.txt.bz2 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 #include 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.