blueprintmrk / isemail

Automatically exported from code.google.com/p/isemail
0 stars 0 forks source link

Java: Unicode hostnames causes crash #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
com.dominicsayers.isemail.dns.DNSLookupException: 
javax.naming.InvalidNameException: Label has two-byte char: مثال; remaining 
name 'مثال.إختبار'
    at com.dominicsayers.isemail.dns.DNSLookup.doLookup(DNSLookup.java:70)
    at com.dominicsayers.isemail.dns.DNSLookup.hasRecords(DNSLookup.java:29)
    at com.dominicsayers.isemail.IsEMail.is_email_verbose(IsEMail.java:709)
    at com.dominicsayers.isemail.IsEMailTest.checkXML(IsEMailTest.java:96)
    at com.dominicsayers.isemail.IsEMailTest.performXMLTests(IsEMailTest.java:132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
    at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: javax.naming.InvalidNameException: Label has two-byte char: 
مثال; remaining name 'مثال.إختبار'
    at com.sun.jndi.dns.DnsName.verifyLabel(Unknown Source)
    at com.sun.jndi.dns.DnsName.add(Unknown Source)
    at com.sun.jndi.dns.DnsName.parse(Unknown Source)
    at com.sun.jndi.dns.DnsName.<init>(Unknown Source)
    at com.sun.jndi.dns.DnsContext.fullyQualify(Unknown Source)
    at com.sun.jndi.dns.DnsContext.c_getAttributes(Unknown Source)
    at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(Unknown Source)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(Unknown Source)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(Unknown Source)
    at javax.naming.directory.InitialDirContext.getAttributes(Unknown Source)
    at com.dominicsayers.isemail.dns.DNSLookup.doLookup(DNSLookup.java:61)
    ... 28 more

Original issue reported on code.google.com by danielma...@googlemail.com on 11 Oct 2010 at 12:26

GoogleCodeExporter commented 9 years ago
Unicode hostnames (Internationalized Domains) now are getting converted into 
valid Punycode hostname. No crash anymore.

Original comment by danielma...@googlemail.com on 11 Oct 2010 at 1:17