RFR [XS]: 8235489: handle return values of sscanf calls in hotspot

Baesken, Matthias matthias.baesken at sap.com
Wed Dec 11 09:21:39 UTC 2019


>
> please use "char name[sizeof(line)]"  rather than copying the size expression.
>

Hi Kim , new webrev  using  sizeof(line)   :

http://cr.openjdk.java.net/~mbaesken/webrevs/8235489.4/

In case I hear no objections, I will push this as XS .

Best regards, Matthias



> 
> > On Dec 10, 2019, at 6:22 AM, Baesken, Matthias
> <matthias.baesken at sap.com> wrote:
> >
> > Hi Kim,   in  the  sscanf  - call we read from array  'line'   .
> > So I think an easy solution for the potential  overflow issue is to make
> 'name'   (at least)  as large as 'line'  .
> > Then we can safely use just %s .
> >
> > New webrev :
> >
> > http://cr.openjdk.java.net/~mbaesken/webrevs/8235489.3/
> 
> I have a mild preference for the "%n" approach, but this alternative
> works too, so okay.  Just one thing; please use "char name[sizeof(line)]"
> rather than copying the size expression.
> 
> Other than that, looks good.



More information about the hotspot-dev mailing list