summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-01-25 02:31:10 +0000
committerkitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-01-25 02:31:10 +0000
commitc0b7cb38e02d59fcac1cda1e0fe783ceeb8795fd (patch)
treebe3470367482b4dc20aaf74155a9bbdc354fedf4
parent5eb2d43416a6fec7d4fb280cead0260fbb61fd10 (diff)
downloadATCD-c0b7cb38e02d59fcac1cda1e0fe783ceeb8795fd.tar.gz
ChangeLogTag: Fri Jan 24 20:28:22 2003 Krishnakumar B <kitty@insanely.long.id.truncated>
-rw-r--r--ACEXML/ChangeLog6
-rw-r--r--ACEXML/parser/parser/Parser.cpp25
2 files changed, 19 insertions, 12 deletions
diff --git a/ACEXML/ChangeLog b/ACEXML/ChangeLog
index a304f29666f..038d5eef1d1 100644
--- a/ACEXML/ChangeLog
+++ b/ACEXML/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jan 24 20:28:22 2003 Krishnakumar B <kitty@insanely.long.id.truncated>
+
+ * parser/parser/Parser.cpp (pop_context): Bail out if there is
+ only one element on the context stack. Bad things [TM] will happen
+ if we pop the only context available.
+
Mon Nov 25 04:25:15 2002 Krishnakumar B <kitty@cs.wustl.edu>
* parser/parser/Parser.cpp (reset):
diff --git a/ACEXML/parser/parser/Parser.cpp b/ACEXML/parser/parser/Parser.cpp
index 7bf9919cdac..d0dc5af23ba 100644
--- a/ACEXML/parser/parser/Parser.cpp
+++ b/ACEXML/parser/parser/Parser.cpp
@@ -2854,6 +2854,14 @@ ACEXML_Parser::push_context (ACEXML_Parser_Context* context)
int
ACEXML_Parser::pop_context (int GE_ref ACEXML_ENV_ARG_DECL)
{
+ int nrelems = this->ctx_stack_.size();
+ if (nrelems <= 1)
+ {
+ this->fatal_error(ACE_TEXT ("Unexpected end-of-file")
+ ACEXML_ENV_ARG_PARAMETER);
+ ACEXML_CHECK_RETURN (-1);
+ }
+
ACEXML_Parser_Context* temp = 0;
int retval = this->ctx_stack_.pop (temp);
if (retval != 0)
@@ -2888,22 +2896,15 @@ ACEXML_Parser::pop_context (int GE_ref ACEXML_ENV_ARG_DECL)
ACEXML_CHECK_RETURN (-1);
}
}
+ nrelems = this->ctx_stack_.size();
+
+ if (this->external_entity_)
+ this->external_entity_--;
- int nrelems = this->ctx_stack_.size();
- if (nrelems >= 1)
- {
- if (this->external_entity_)
- this->external_entity_--;
- }
- else
- {
- this->fatal_error(ACE_TEXT ("Unexpected end-of-file")
- ACEXML_ENV_ARG_PARAMETER);
- ACEXML_CHECK_RETURN (-1);
- }
// Set up Locator.
if (this->content_handler_)
this->content_handler_->setDocumentLocator (this->current_->getLocator());
+
return nrelems;
}