From 674df787418f4a9d0c5982ace95801715a41f3f0 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 21 Oct 2014 21:55:47 +0200 Subject: [PATCH 1/2] Fix parsing exception causing infinite loop Fixes SMACK-613 --- .../org/jivesoftware/smack/tcp/PacketReader.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/PacketReader.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/PacketReader.java index b5bf1f192..398c274da 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/PacketReader.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/PacketReader.java @@ -160,6 +160,10 @@ class PacketReader { if (callback != null) { callback.handleUnparsablePacket(message); } + // The parser is now at the end tag of the unparsable stanza. We need to advance to the next + // start tag in order to avoid an exception which would again lead to the execution of the + // catch block becoming effectively an endless loop. + eventType = parser.next(); continue; } connection.processPacket(packet); @@ -174,6 +178,10 @@ class PacketReader { if (callback != null) { callback.handleUnparsablePacket(message); } + // The parser is now at the end tag of the unparsable stanza. We need to advance to the next + // start tag in order to avoid an exception which would again lead to the execution of the + // catch block becoming effectively an endless loop. + eventType = parser.next(); continue; } connection.processPacket(iq); @@ -188,6 +196,10 @@ class PacketReader { if (callback != null) { callback.handleUnparsablePacket(message); } + // The parser is now at the end tag of the unparsable stanza. We need to advance to the next + // start tag in order to avoid an exception which would again lead to the execution of the + // catch block becoming effectively an endless loop. + eventType = parser.next(); continue; } connection.processPacket(presence); From 04446e54db9a6fffbb5f031971157a09b9b7c0ac Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 22 Oct 2014 22:11:07 +0200 Subject: [PATCH 2/2] Smack 4.0.5 --- build.gradle | 2 +- resources/releasedocs/changelog.html | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 95ca0aa88..5a6b20914 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ allprojects { ext { shortVersion = '4.0.5' - isSnapshot = true + isSnapshot = false gitCommit = getGitCommit() javadocAllDir = new File(buildDir, 'javadoc') documentationDir = new File(buildDir, 'documentation') diff --git a/resources/releasedocs/changelog.html b/resources/releasedocs/changelog.html index e7ad391c7..e499364da 100644 --- a/resources/releasedocs/changelog.html +++ b/resources/releasedocs/changelog.html @@ -141,6 +141,17 @@ hr {
+

4.0.5 -- 2014-10-22

+ +

Bug +

+
    +
  • [SMACK-609] - PingManager.ping(String, long) does not respect timeout +
  • +
  • [SMACK-613] - Parsing exception causes infinite loop if the exception is not thrown +
  • +
+

4.0.4 -- 2014-09-05

Bug