powered by Jive Software

A bug in RosterExtension or in EscapedJID or in Roster

When clients load roster from a server, RosterExtension.deserialize(XMLNode) is called.

See line 117 in RosterExtension, serveral RosterItem(s) are constructed. At this moment, all jids are escaped ones, and all RosterItems are kept in an array variable myItem, defined at line 40 in RosterExtension

Assume one of my jids is “a b c \ \ 4 0 m s n . c o m @ m y d o m a i n”. Ignore the mail icon in the jid, please.

After a while, Roster.fetchRoster_result(IQ) is called, see line 390, new UnescapedJID(item.jid). When item.jid is called, it constructs an EscapedJID, which makes the jid to be “a b c \ \ 5 c 4 0 m s n . c o m @ m y d o m a i n”.

Then UnescapedJID will mak the jid to be “a b c \ 4 0 m s n . c o m @ m y d o m a i n”. In fact, the result is “a b c \ \ 5 c 4 0 m s n . c o m @ m y d o m a i n” instead of “a b c \ \ 4 0 @ m s n . c o m @ m y d o m a i n”, because there is alose a bug in UnescapedJID, I post a thread to show the bug of Unescaped.