Re: RFR: 8282395: URL.openConnection can throw IOOBE [v2]

2022-06-07 Thread KIRIYAMA Takuya
> I fixed sun.net.www.ParseUtil.decode(). > > ParseUtil.decode() always tries to decode after parsing '%', so if '%' is > located at the end of the String, IndexOutOfBoundsException is thrown. Also, > if '%' is shown after decodable string and following string is not decodable > (e.g: "%25%s%G1

Re: RFR: 8282395: URL.openConnection can throw IOOBE

2022-06-07 Thread KIRIYAMA Takuya
On Fri, 8 Apr 2022 07:52:55 GMT, KIRIYAMA Takuya wrote: > I fixed sun.net.www.ParseUtil.decode(). > > ParseUtil.decode() always tries to decode after parsing '%', so if '%' is > located at the end of the String, IndexOutOfBoundsException is thrown. Also, > if '%' is shown after decodable strin

Re: RFR: 8282395: URL.openConnection can throw IOOBE

2022-04-18 Thread KIRIYAMA Takuya
On Thu, 14 Apr 2022 08:47:12 GMT, Daniel Fuchs wrote: > It is not a valid escape sequence according to the spec. I see. JavaAPI document says that Escaped octets, that is, triplets consisting the percent character ('%') followed by two hexadecimal digits. Also, RFC 2396 says that '%' must be

Re: RFR: 8282395: URL.openConnection can throw IOOBE

2022-04-14 Thread Daniel Fuchs
On Thu, 14 Apr 2022 06:56:24 GMT, KIRIYAMA Takuya wrote: > I think we should accept any codes like "%25%s%G1" according to URL standard. > > Is there a reason why an exception should be thrown? Yes. It is not a valid escape sequence according to the spec. jshell> URI.create("ftp://host:5678/%

Re: RFR: 8282395: URL.openConnection can throw IOOBE

2022-04-14 Thread KIRIYAMA Takuya
On Fri, 8 Apr 2022 09:01:40 GMT, Daniel Fuchs wrote: > MalformedURLException should probably be thrown instead of simply accepting a > malformed % encoded pair. Thank you very much for your comment. I think we should accept any codes like "%25%s%G1" according to URL standard. Is there a re

Re: RFR: 8282395: URL.openConnection can throw IOOBE

2022-04-13 Thread KIRIYAMA Takuya
On Fri, 8 Apr 2022 08:35:12 GMT, Alan Bateman wrote: > Are there examples using URL/URLconnection (rather than ParseUtil directly) > to demonstrate the issue? I’m sorry for the late reply. Thre is the example in [JDK-8282395](https://bugs.openjdk.java.net/browse/JDK-8282395). This is a simp

Re: RFR: 8282395: URL.openConnection can throw IOOBE

2022-04-08 Thread Daniel Fuchs
On Fri, 8 Apr 2022 07:52:55 GMT, KIRIYAMA Takuya wrote: > I fixed sun.net.www.ParseUtil.decode(). > > ParseUtil.decode() always tries to decode after parsing '%', so if '%' is > located at the end of the String, IndexOutOfBoundsException is thrown. Also, > if '%' is shown after decodable strin

Re: RFR: 8282395: URL.openConnection can throw IOOBE

2022-04-08 Thread Alan Bateman
On Fri, 8 Apr 2022 07:52:55 GMT, KIRIYAMA Takuya wrote: > I fixed sun.net.www.ParseUtil.decode(). > > ParseUtil.decode() always tries to decode after parsing '%', so if '%' is > located at the end of the String, IndexOutOfBoundsException is thrown. Also, > if '%' is shown after decodable strin

RFR: 8282395: URL.openConnection can throw IOOBE

2022-04-08 Thread KIRIYAMA Takuya
I fixed sun.net.www.ParseUtil.decode(). ParseUtil.decode() always tries to decode after parsing '%', so if '%' is located at the end of the String, IndexOutOfBoundsException is thrown. Also, if '%' is shown after decodable string and following string is not decodable (e.g: "%25%s%G1"), ParseUti