On 1/8/21 10:39 AM, Bruce Korb via Gcc wrote:
> Hi,
>
> You are supposed to be able to post once you've subscribed.
>
> Also, GCC's code analysis is wrong. "name_bf" contains *NO MORE* than
> MAXNAMELEN characters. That is provable.
>
> "def_str" points into a buffer of size ((MAXNAMELEN * 2) + 8) and at
> an offset maximum of MAXNAMELEN+1 (also provable), meaning that at a
> minimum there are MAXNAMELEN+6 bytes left in the buffer.
>
> That objected-to sprintf can add a maximum of MAXNAMELEN + 4 to where
> "def_str" points.
>
> GCC is wrong. It is unable to figure out how far into the buffer
> "def_str" can point.
Can you get a .i file, command line and file a report.  It'd be appreciated.

jeff

Reply via email to