Re: [PATCH] printf width/precision argument overflow

2023-10-21 Thread Chet Ramey
On 10/19/23 11:45 PM, Grisha Levit wrote: When reading a printf width/precision argument, the value isn't checked for overflow if it happens to be the last argument: Thanks for the report. There are a couple more things we need to do in the case of field width or precision overflow. Chet -- `

[PATCH] printf width/precision argument overflow

2023-10-19 Thread Grisha Levit
When reading a printf width/precision argument, the value isn't checked for overflow if it happens to be the last argument: $ INT_MAX=$(getconf INT_MAX) $ printf '[%*s]' "$((INT_MAX+1))" [] $ printf '[%*s]' "$((INT_MAX+1))" X -bash: printf: X: Result too large [] ..and the