summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2004-09-21 16:22:46 +0000
committerSteve Huston <shuston@riverace.com>2004-09-21 16:22:46 +0000
commitf0a0fd699a178a405de6972ae1393ceec4fffeaf (patch)
tree03fc5f0d902c95fc1ef565ba0228f82c4d5d7fa3
parent44cfc12e497af4cbb43ce64e3e020cd5cf87ba10 (diff)
downloadATCD-f0a0fd699a178a405de6972ae1393ceec4fffeaf.tar.gz
ChangeLogTag:Tue Sep 21 12:16:39 2004 Steve Huston <shuston@riverace.com>
-rw-r--r--ACEXML/parser/parser/Parser.cpp13
-rw-r--r--ChangeLog7
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 <shuston@riverace.com>
+
+ * 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 <jwillemsen@remedy.nl>
* tests/QtReactor_Test.cpp: