powered by Jive Software

Namespace related bugs in PacketReader

Here are some valid message packets that cause

PacketReader.parseMessage() to throw a connection closing Exception.

<message to=’‘user@example.com’’><subject xmlns=’‘unexpected:namespace’’>

<message to=’‘user@example.com’’><body xmlns=’‘unexpected:namespace’’>

<message to=’‘user@example.com’’><thread xmlns=’‘unexpected:namespace’’>

Can you paste in the exact error message/stack trace you’'re getting?

Thanks,

Matt

Here’'s the stack trace:

org.xmlpull.v1.XmlPullParserException: parser must be on START_TAG or TEXT to read text (position: START_TAG seen …<body xmlns=’‘unexpected:namespace’’>… @3:181)

at org.xmlpull.mxp1.MXParser.nextText(MXParser.java:1115)

at org.jivesoftware.smack.PacketReader.parseMessage(PacketReader.java:649)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:274)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:77)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:103)

I think the problem is with this code in PacketReader.parseMessage():

else if (elementName.equals(“body”)) {

if (body == null) {

body = parser.nextText();

}

}

It should check the namespace on the body element.