Packet with wrong date format makes Smack to disconnect

Description

reported at: http://www.igniterealtime.org/community/thread/32742
affects Spark (and other Smack based clients): http://www.igniterealtime.org/community/thread/33364

tested with Openfire and gtalk (so it shouldnt be affected only by Openfire bug)

faulty packet example:

<message to="victim@hisserver.fr/spark" type="chat" id="1345">
<body>plop</body>
<x xmlns="jabber:x:delay" stamp="200868T09:16:20" from="mylogin@monserver.fr"/>
<thread>9gOp44</thread>
</message>

Environment

None

Attachments

2

Activity

Show:

Florian Schmaus May 3, 2013 at 9:32 AM

@Marcelo Maybe you should mention that you where making these changes in the openfire source code. This is tracked as and has been fixed in the trunk.

Marcelo Soares da Silva May 2, 2013 at 7:04 PM

Hi

I had same problems. Working on it I found and fixed an error on:

src\java\org\jivesoftware\util\XMPPDateTimeFormat.java

changing:

ln 99: Matcher xep82WoMillisMatcher = xep80DateTimePattern.matcher(dateString);
ln 100: Matcher xep82Matcher = xep80DateTimeWoMillisPattern.matcher(dateString);

for

ln 99: Matcher xep82Matcher = xep80DateTimePattern.matcher(dateString);
ln100: Matcher xep82WoMillisMatcher = xep80DateTimeWoMillisPattern.matcher(dateString);

Best Regards

Marcelo

Henning Staib August 15, 2010 at 1:21 PM

fixed in revision 11823

Henning Staib June 20, 2010 at 4:59 PM

moved the XEP_0082_UTC_FORMAT DateFormat from the core class Packet to the StringUtils class (as suggested by Guus).
Added synchronized methods to access the formatter and replaced all usage of the formatter with this methods.

Henning Staib April 7, 2010 at 4:24 PM

Your stream error problem and the fixes of my patch are not connected.
The patch fixes parsing a <message> or <presence> tag containing a <delay> tag with an errornous date.

Your problem seems to be that one of the entities you are communicating with sends an error in the XML stream.
(<stream> ... <message>...</message> ... <error>text</error> ... </stream>). So you should check why this error is sent.

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created June 12, 2008 at 3:44 PM
Updated October 7, 2013 at 2:35 AM
Resolved November 23, 2010 at 1:21 AM