From 8133dcd881af0d89b0ed32d7da944b425975597a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 23 May 2014 10:15:58 +0200 Subject: [PATCH] fixed possible npe --- src/eu/siacs/conversations/xmpp/XmppConnection.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index fa4fa10a4..a1aaf66a1 100644 --- a/src/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java @@ -330,6 +330,9 @@ public class XmppConnection implements Runnable { } element.setAttributes(currentTag.getAttributes()); Tag nextTag = tagReader.readTag(); + if (nextTag==null) { + throw new IOException("interrupted mid tag"); + } while (!nextTag.isEnd(element.getName())) { if (!nextTag.isNo()) { Element child = tagReader.readElement(nextTag); @@ -341,6 +344,9 @@ public class XmppConnection implements Runnable { element.addChild(child); } nextTag = tagReader.readTag(); + if (nextTag==null) { + throw new IOException("interrupted mid tag"); + } } ++stanzasReceived; lastPaketReceived = SystemClock.elapsedRealtime();