[
https://issues.apache.org/jira/browse/DIRSERVER-1093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Emmanuel Lecharny resolved DIRSERVER-1093.
------------------------------------------
Resolution: Fixed
Fix Version/s: 2.0.0-M7
Applied the suggested corrections with
http://svn.apache.org/viewvc?rev=1294444&view=rev
> the ResourceRecordEncoder and QuestionRecordEncoder have bug for empty
> domainName:(
> ------------------------------------------------------------------------------------
>
> Key: DIRSERVER-1093
> URL: https://issues.apache.org/jira/browse/DIRSERVER-1093
> Project: Directory ApacheDS
> Issue Type: Bug
> Components: dns
> Affects Versions: 1.5.1
> Environment: Windows XP , apacheds-protocol-dns-1.5.1.jar
> Reporter: lizongbo
> Assignee: Enrique Rodriguez
> Fix For: 2.0.0-M7, 2.0.0
>
> Attachments: correct4trace.jpg, error4trace.jpg, testcommand.jpg
>
>
> When I use dig trace for Test the apache dns server. the QuestionRecord
> and ResourceRecord not encoded right for the empty Domain Name.
> my Test command is:
> E:\bind>dig @10.108.20.126 618119.com +trace
> Then found this bug is caeused by the method "encodeDomainName" in
> QuestionRecordEncoder.java and "putDomainName" in ResourceRecordEncoder.java.
> follow code can be test to get "labels.length == 1";
> [code]
> String s = "";
> String[] labels = new String[0];
> labels = s.split("\\.");
> System.out.println("labels.length == " + labels.length);
> [/code]
> so i fix this bug by follow change :
> [code]
> String[] labels = domainName.split( "\\." );
> [/code]
> change to:
> [code]
> String[] labels = new String[0];
> if (domainName != null && domainName.length() > 0) {
> labels = domainName.split("\\.");
> }
> [/code]
> Please fix the bug:)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira