From 882b088fbb27f0391a128179c30d87d52ee02883 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Mon, 23 Apr 2012 18:23:11 +0200 Subject: [PATCH] Close the stream when restricted XML is received --- src/XMPPConnection.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/XMPPConnection.m b/src/XMPPConnection.m index b196f1e..0b9eb8e 100644 --- a/src/XMPPConnection.m +++ b/src/XMPPConnection.m @@ -315,8 +315,14 @@ return; } - [parser parseBuffer: buffer - length: length]; + @try { + [parser parseBuffer: buffer + length: length]; + } @catch (OFMalformedXMLException *e) { + [self XMPP_sendStreamError: @"bad-format" + text: nil]; + [self close]; + } [oldParser release]; [oldElementBuilder release];