Re: RFR 8183591: Incorrect behavior when reading DER value with Integer.MAX_VALUE length

2017-07-20 Thread Sean Mullan
Looks good to me. --Sean On 7/20/17 9:49 AM, Adam Petcher wrote: Oops. Better to throw an IOException when a negative length is given to readFully. Webrev: http://cr.openjdk.java.net/~apetcher/8183591/webrev.02/ On 7/18/2017 1:55 PM, Adam Petcher wrote: Some additional investigation reveale

Re: RFR 8183591: Incorrect behavior when reading DER value with Integer.MAX_VALUE length

2017-07-20 Thread Adam Petcher
On 7/20/2017 1:32 PM, Bernd wrote: Why not make a different utility method for this case. readRemaining() vs. readFully(int) The name makes not much sense and the code does not get easier if both cases are in one method for no good reason. I agree, but the method that takes a length argume

Re: RFR 8183591: Incorrect behavior when reading DER value with Integer.MAX_VALUE length

2017-07-20 Thread Bernd
Why not make a different utility method for this case. readRemaining() vs. readFully(int) The name makes not much sense and the code does not get easier if both cases are in one method for no good reason. And I wonder if allocating a MAXINTEGER buffer from untrusted source is a good idea. Grus

Re: RFR 8183591: Incorrect behavior when reading DER value with Integer.MAX_VALUE length

2017-07-20 Thread Adam Petcher
Oops. Better to throw an IOException when a negative length is given to readFully. Webrev: http://cr.openjdk.java.net/~apetcher/8183591/webrev.02/ On 7/18/2017 1:55 PM, Adam Petcher wrote: Some additional investigation revealed that IOUtils.readFully() is only used by DER, JKS, and Kerberos.