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

Kim Barrett kim.barrett at oracle.com
Tue Dec 10 20:27:27 UTC 2019


> 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