From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 002D33857007; Tue, 7 Jul 2020 22:53:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 002D33857007 From: "jsm28 at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug stdio/26214] New: printf_fp double free Date: Tue, 07 Jul 2020 22:53:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: stdio X-Bugzilla-Version: 2.32 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jsm28 at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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 target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2020 22:53:49 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26214 Bug ID: 26214 Summary: printf_fp double free Product: glibc Version: 2.32 Status: NEW Severity: normal Priority: P2 Component: stdio Assignee: unassigned at sourceware dot org Reporter: jsm28 at gcc dot gnu.org Target Milestone: --- __printf_fp_l has a double free bug in the case where it allocates memory w= ith malloc internally, then has an I/O error while outputting trailing padding = and tries to free that already-freed memory when the error occurs. The following test reproduces that bug (with a segfault). #include #include int main (void) { FILE *fp; char buf[131072]; if ((fp =3D fopen ("/dev/full", "w")) =3D=3D NULL) exit (1); if (setvbuf (fp, buf, _IOFBF, sizeof buf) !=3D 0) exit (2); fprintf (fp, "%-1000000.65536f", 1.0); } --=20 You are receiving this mail because: You are on the CC list for the bug.=