This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug stdio/17829] Incorrect handling of precision specifier in printf family


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]