Jive Software Open Source

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Tinder
  • TINDER-32

fix length check of node, domain and resource identifier

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.2 - Building Blocks
  • Fix Version/s: None
  • Labels:
    None
  • Acceptance Test - Add?:
    No

Description

RFC3920 does define:

Each allowable portion of a JID (node identifier, domain identifier, and resource identifier) MUST NOT be more than 1023 bytes in length, resulting in a maximum total size (including the '@' and '/' separators) of 3071 bytes.

I've seen this problem just in org.xmpp.packet.JID, line 368, "if (domain.length()*2 > 1023) {" but it may occur also somewhere else.
The right way to check the length in this case is domain.getBytes("UTF-8").length to match the requirement "1023 bytes in length".

Short sample code:

String y = "\u0001\uD11E";

// 2
System.out.println(y.length());

// 4
System.out.println(y.getBytes("UTF-8").length);         

// "\u20AC"
String z = "€";                                                                     

// 1
System.out.println(z.length());                                        

// 3
System.out.println(z.getBytes("UTF-8").length);

reference: http://de.wikipedia.org/wiki/UTF-8 - "Beispiele für UTF-8 Kodierungen"

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Source
  • Reviews
  • Builds
Hide
Permalink
Andreas Köhler added a comment - 10/12/09 12:24 PM

Any update here?
I am interested in a fix within tinder.

Show
Andreas Köhler added a comment - 10/12/09 12:24 PM Any update here? I am interested in a fix within tinder.
Hide
Permalink
Guus der Kinderen added a comment - 10/12/09 07:51 PM

This issue has been moved from the (archived) Openfire project to the Tinder project. The old issue reference JM-852 shall from this point forwards be known as TINDER-32.

Show
Guus der Kinderen added a comment - 10/12/09 07:51 PM This issue has been moved from the (archived) Openfire project to the Tinder project. The old issue reference JM-852 shall from this point forwards be known as TINDER-32.
Hide
Permalink
Guus der Kinderen added a comment - 10/12/09 09:02 PM

Various unit tests have been modified to expose the bug described in this issue.

Show
Guus der Kinderen added a comment - 10/12/09 09:02 PM Various unit tests have been modified to expose the bug described in this issue.
Hide
Permalink
Guus der Kinderen added a comment - 10/12/09 09:33 PM

A fix has been checked in. The JID class now uses getBytes("UTF-8") to determine the length of node, domain and resource parts.

Show
Guus der Kinderen added a comment - 10/12/09 09:33 PM A fix has been checked in. The JID class now uses getBytes("UTF-8") to determine the length of node, domain and resource parts.
Hide
Permalink
Guus der Kinderen added a comment - 10/13/09 08:46 AM

Community discussion related to this issue at http://www.igniterealtime.org/community/message/196926

Show
Guus der Kinderen added a comment - 10/13/09 08:46 AM Community discussion related to this issue at http://www.igniterealtime.org/community/message/196926

People

  • Assignee:
    Guus der Kinderen
    Reporter:
    LG
Vote (0)
Watch (1)

Dates

  • Created:
    09/25/06 11:55 PM
    Updated:
    10/13/09 08:46 AM
    Resolved:
    10/12/09 09:33 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for igniterealtime.org. Try JIRA - bug tracking software for your team.