Files
@ 0729d364ca25
Branch filter:
Location: libtransport.git/include/Swiften/Parser/PayloadParsers/XHTMLIMParser.cpp - annotation
0729d364ca25
1.5 KiB
text/x-c++hdr
Fix double free in DummyConnectionServer
Do not create shared ptr from this as this lead to double free in
UserRegistryTest::login test. Shared ptr was needed to set event
owner in acceptConnection, actually it is never needed as events
are never filtered by owner. Thus it was removed and there is no
need to create shared ptr from this.
Do not create shared ptr from this as this lead to double free in
UserRegistryTest::login test. Shared ptr was needed to set event
owner in acceptConnection, actually it is never needed as events
are never filtered by owner. Thus it was removed and there is no
need to create shared ptr from this.
64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 6d2f8c192761 64f1921f8d5c 64f1921f8d5c 6d2f8c192761 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c a9ccbdc50107 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 6d2f8c192761 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c | /*
* Copyright (c) 2011 Jan Kaluza
* Licensed under the Simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
#include <cassert>
#include <Swiften/Parser/PayloadParsers/XHTMLIMParser.h>
#include <Swiften/Parser/SerializingParser.h>
#include "Swiften/SwiftenCompat.h"
namespace Swift {
XHTMLIMParser::XHTMLIMParser() : level_(TopLevel), bodyParser_(0) {
}
void XHTMLIMParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
++level_;
if (level_ == BodyLevel) {
if (element == "body") {
assert(!bodyParser_);
bodyParser_ = new SerializingParser();
}
}
else if (level_ >= InsideBodyLevel && bodyParser_) {
bodyParser_->handleStartElement(element, "", attributes);
}
}
void XHTMLIMParser::handleEndElement(const std::string& element, const std::string& ns) {
if (level_ == BodyLevel) {
if (bodyParser_) {
if (element == "body") {
getPayloadInternal()->setBody(bodyParser_->getResult());
}
delete bodyParser_;
bodyParser_ = 0;
}
}
else if (bodyParser_ && level_ >= InsideBodyLevel) {
bodyParser_->handleEndElement(element, ns);
}
--level_;
}
void XHTMLIMParser::handleCharacterData(const std::string& data) {
if (bodyParser_) {
bodyParser_->handleCharacterData(data);
}
else {
currentText_ += data;
}
}
SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<XHTMLIMPayload> XHTMLIMParser::getLabelPayload() const {
return getPayloadInternal();
}
}
|