From f0a0fd699a178a405de6972ae1393ceec4fffeaf Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Tue, 21 Sep 2004 16:22:46 +0000 Subject: ChangeLogTag:Tue Sep 21 12:16:39 2004 Steve Huston --- ACEXML/parser/parser/Parser.cpp | 13 ++++++++----- ChangeLog | 7 +++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ACEXML/parser/parser/Parser.cpp b/ACEXML/parser/parser/Parser.cpp index d60a9b35c31..2b7b722e608 100644 --- a/ACEXML/parser/parser/Parser.cpp +++ b/ACEXML/parser/parser/Parser.cpp @@ -3161,7 +3161,7 @@ ACEXML_Parser::parse_encoding_decl (ACEXML_ENV_SINGLE_ARG_DECL) ACEXML_CHECK; } const ACEXML_Char* encoding = this->current_->getInputSource()->getEncoding(); - if (ACE_OS::strcmp (astring, encoding) != 0) + if (encoding != 0 && ACE_OS::strcmp (astring, encoding) != 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("Detected Encoding is %s ") ACE_TEXT (": Declared Encoding is %s\n"), @@ -3351,11 +3351,14 @@ ACEXML_Parser::reset (void) if (this->ctx_stack_.pop (this->current_) == -1) ACE_ERROR ((LM_ERROR, ACE_TEXT ("Mismatched push/pop of Context stack"))); - this->current_->getInputSource()->getCharStream()->rewind(); + if (this->current_) + { + this->current_->getInputSource()->getCharStream()->rewind(); - this->current_->setInputSource (0); - delete this->current_; - this->current_ = 0; + this->current_->setInputSource (0); + delete this->current_; + this->current_ = 0; + } ACEXML_Char* temp = 0; while (this->GE_reference_.pop (temp) != -1) diff --git a/ChangeLog b/ChangeLog index b5a30a8286d..be1348b7cf1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Sep 21 12:16:39 2004 Steve Huston + + * ACEXML/parser/parser/Parser.cpp: parse_encoding_decl(), don't + crash if the input source doesn't declare an encoding. + reset(), if current_ is already 0 (the case if no parsing ever + really got started) don't dereference it. + Tue Sep 21 15:29:12 UTC 2004 Johnny Willemsen * tests/QtReactor_Test.cpp: -- cgit v1.2.1