Code review request, 8020842 IDN do not throw IAE when hostname ends with a trailing dot

Matthew Hall mhall at mhcomputing.net
Tue Aug 6 16:06:16 UTC 2013


Trailing dots are allowed in plain DNS (thus almost surely in IDN), and the single dot represents the root zone. So you have to be careful making this sort of change to check the DNS RFCs first.

Matthew.
-- 
Sent from my mobile device.

Weijun Wang <weijun.wang at oracle.com> wrote:
>I am not sure if IDN.java is the correct place to change. At least I've
>
>seen trailing dots in DNS entries. So maybe it's not so illegal.
>
>--Max
>
>On 8/6/13 7:44 PM, Xuelei Fan wrote:
>> Hi,
>>
>> Please review the bug fix to strict the illegal input checking in
>IDN.
>>
>> webrev: http://cr.openjdk.java.net./~xuelei/8020842/webrev.00/
>>
>> Here is two test cases, which are expected to get IAE.
>>
>> Case 1:
>> String host = IDN.toASCII(".", IDN.USE_STD3_ASCII_RULES);
>> Exception in thread "main" java.lang.StringIndexOutOfBoundsException:
>> String index out of range: 0
>>          at java.lang.StringBuffer.charAt(StringBuffer.java:204)
>>          at java.net.IDN.toASCIIInternal(IDN.java:279)
>>          at java.net.IDN.toASCII(IDN.java:118)
>>
>> Case 2:
>> String host = IDN.toASCII("com.", IDN.USE_STD3_ASCII_RULES);
>>
>> Thanks,
>> Xuelei
>>




More information about the security-dev mailing list