public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/30068] New: incorrect printf output for integers with thousands separator and width field
@ 2023-02-02  1:16 vincent-srcware at vinc17 dot net
  2023-02-02  1:17 ` [Bug stdio/30068] " vincent-srcware at vinc17 dot net
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: vincent-srcware at vinc17 dot net @ 2023-02-02  1:16 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 30068
           Summary: incorrect printf output for integers with thousands
                    separator and width field
           Product: glibc
           Version: 2.37
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: vincent-srcware at vinc17 dot net
  Target Milestone: ---

Consider the following C program:

#include <stdio.h>
#include <locale.h>

int main (void)
{
  if (setlocale (LC_ALL, ""))
    {
      printf ("1234567890123:\n");
      printf ("%0+ -'13ld:\n", 1234567L);
    }
  return 0;
}

and try it with a locale that has a thousands separator, such as
"LC_ALL=en_US.utf8".

With glibc up to 2.36, I get as expected:

1234567890123:
+1,234,567   :

But I got a report from Klaus Dittrich (following his bug reports against GNU
MPFR at https://sympa.inria.fr/sympa/arc/mpfr/2023-01/msg00001.html and
https://sympa.inria.fr/sympa/arc/mpfr/2023-01/msg00017.html) that with glibc
git on 2023-01-17, one gets:

1234567890123:
+1,234,567     :

i.e. padding is done to width 15 instead of 13.

I've got another report that the MPFR test also fails with glibc 2.37, which is
probably the above issue.

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

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

end of thread, other threads:[~2023-02-08  1:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02  1:16 [Bug stdio/30068] New: incorrect printf output for integers with thousands separator and width field vincent-srcware at vinc17 dot net
2023-02-02  1:17 ` [Bug stdio/30068] " vincent-srcware at vinc17 dot net
2023-02-02  2:25 ` vincent-srcware at vinc17 dot net
2023-02-02  7:51 ` freswa at archlinux dot org
2023-02-02  8:54 ` vincent-srcware at vinc17 dot net
2023-02-02 11:25 ` xry111 at xry111 dot site
2023-02-02 12:40 ` xry111 at xry111 dot site
2023-02-02 14:27 ` carlos at redhat dot com
2023-02-02 14:27 ` carlos at redhat dot com
2023-02-02 16:41 ` sam at gentoo dot org
2023-02-02 22:17 ` siddhesh at sourceware dot org
2023-02-02 22:19 ` siddhesh at sourceware dot org
2023-02-03 11:56 ` [Bug stdio/30068] incorrect printf output for integers with thousands separator and width field (CVE-2023-25139) siddhesh at sourceware dot org
2023-02-06 15:24 ` carlos at redhat dot com
2023-02-06 18:03 ` carlos at redhat dot com
2023-02-08  1:32 ` carlos at redhat dot com

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).