Re: [PATCH] printf: more error handling

2024-02-05 Thread Grisha Levit
On Sat, Feb 3, 2024 at 1:05 PM Chet Ramey wrote: > > On 2/2/24 6:33 PM, Grisha Levit wrote: > > Is it necessary to check the error indicator if printf(3) just had a non- > > negative return? > > I think printf is allowed to set the error flag that ferror checks even if > it returns 0, but I could

Re: [PATCH] printf: more error handling

2024-02-03 Thread Chet Ramey
On 2/2/24 6:33 PM, Grisha Levit wrote: On Thu, Feb 1, 2024 at 7:41 PM Chet Ramey wrote: On 1/22/24 9:44 PM, Grisha Levit wrote: The size of the buffer used for printf -v is tracked in an int but this can overflow since the buffer can be built up by multiple vsnprintf(3) calls, each of which c

Re: [PATCH] printf: more error handling

2024-02-02 Thread Grisha Levit
On Thu, Feb 1, 2024 at 7:41 PM Chet Ramey wrote: > > On 1/22/24 9:44 PM, Grisha Levit wrote: > > The size of the buffer used for printf -v is tracked in an int but this > > can overflow since the buffer can be built up by multiple vsnprintf(3) > > calls, each of which can append up to INT_MAX byte

Re: [PATCH] printf: more error handling

2024-02-01 Thread Chet Ramey
On 1/22/24 9:44 PM, Grisha Levit wrote: The size of the buffer used for printf -v is tracked in an int but this can overflow since the buffer can be built up by multiple vsnprintf(3) calls, each of which can append up to INT_MAX bytes to the buffer: Thanks for the report and patch. Chet -- ``