This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug stdio/17829] Incorrect handling of precision specifier in printf family
- From: "cherepan at mccme dot ru" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 23 Dec 2015 00:05:21 +0000
- Subject: [Bug stdio/17829] Incorrect handling of precision specifier in printf family
- Auto-submitted: auto-generated
- References: <bug-17829-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17829
Alexander Cherepanov <cherepan at mccme dot ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |cherepan at mccme dot ru
--- Comment #5 from Alexander Cherepanov <cherepan at mccme dot ru> ---
To add to two already mentioned problems (unnecessary malloc and fail for
INT_MAX):
C11 seems not to specify any limit for a precision and values larger than
INT_MAX could be useful. The variable for precision is declared as int[1] and
extracted from a format string as int with overflow control[2]. A larger type
like size_t and something like saturated processing of the number is a better
fit.
[1]
https://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/vfprintf.c;h=ae0145295479d0da11ae6bd496bd7039546419de;hb=HEAD#l1359
[2]
https://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/printf-parse.h;h=e9903549997b113c5a38be3c2a463c2d83954c51;hb=HEAD#l68
--
You are receiving this mail because:
You are on the CC list for the bug.