Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 314860 Details for
Bug 459830
latest libxml2 advisory breaks gnome initialization (gnome-panel?, nautilus?, gconf?)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
another patch related to upstream but using the owner field of the entity structure
new_patch (text/plain), 8.09 KB, created by
Daniel Veillard
on 2008-08-23 09:07:12 UTC
(
hide
)
Description:
another patch related to upstream but using the owner field of the entity structure
Filename:
MIME Type:
Creator:
Daniel Veillard
Created:
2008-08-23 09:07:12 UTC
Size:
8.09 KB
patch
obsolete
>Index: include/libxml/parser.h >=================================================================== >--- include/libxml/parser.h (revision 3771) >+++ include/libxml/parser.h (working copy) >@@ -297,6 +297,7 @@ struct _xmlParserCtxt { > */ > xmlError lastError; > xmlParserMode parseMode; /* the parser mode */ >+ unsigned long nbentities; /* number of entities references */ > }; > > /** >Index: entities.c >=================================================================== >--- entities.c (revision 3771) >+++ entities.c (working copy) >@@ -102,7 +102,7 @@ xmlFreeEntity(xmlEntityPtr entity) > dict = entity->doc->dict; > > >- if ((entity->children) && (entity->owner == 1) && >+ if ((entity->children) && (entity->owner != 0) && > (entity == (xmlEntityPtr) entity->children->parent)) > xmlFreeNodeList(entity->children); > if (dict != NULL) { >Index: parserInternals.c >=================================================================== >--- parserInternals.c (revision 3771) >+++ parserInternals.c (working copy) >@@ -1670,6 +1670,7 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt) > ctxt->depth = 0; > ctxt->charset = XML_CHAR_ENCODING_UTF8; > ctxt->catalogs = NULL; >+ ctxt->nbentities = 0; > xmlInitNodeInfoSeq(&ctxt->node_seq); > return(0); > } >Index: parser.c >=================================================================== >--- parser.c (revision 3771) >+++ parser.c (working copy) >@@ -2379,7 +2379,7 @@ xmlStringLenDecodeEntities(xmlParserCtxt > return(NULL); > last = str + len; > >- if (ctxt->depth > 40) { >+ if ((ctxt->depth > 40) || (ctxt->nbentities >= 500000)) { > xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL); > return(NULL); > } >@@ -2417,6 +2417,11 @@ xmlStringLenDecodeEntities(xmlParserCtxt > "String decoding Entity Reference: %.30s\n", > str); > ent = xmlParseStringEntityRef(ctxt, &str); >+ if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP) >+ goto int_error; >+ ctxt->nbentities++; >+ if (ent != NULL) >+ ctxt->nbentities += ent->owner; > if ((ent != NULL) && > (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) { > if (ent->content != NULL) { >@@ -2462,6 +2467,11 @@ xmlStringLenDecodeEntities(xmlParserCtxt > xmlGenericError(xmlGenericErrorContext, > "String decoding PE Reference: %.30s\n", str); > ent = xmlParseStringPEReference(ctxt, &str); >+ if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP) >+ goto int_error; >+ ctxt->nbentities++; >+ if (ent != NULL) >+ ctxt->nbentities += ent->owner; > if (ent != NULL) { > if (ent->content == NULL) { > if (xmlLoadEntityContent(ctxt, ent) < 0) { >@@ -2501,6 +2511,7 @@ xmlStringLenDecodeEntities(xmlParserCtxt > > mem_error: > xmlErrMemory(ctxt, NULL); >+int_error: > if (rep != NULL) > xmlFree(rep); > if (buffer != NULL) >@@ -3542,6 +3553,9 @@ xmlParseAttValueComplex(xmlParserCtxtPtr > } > } else { > ent = xmlParseEntityRef(ctxt); >+ ctxt->nbentities++; >+ if (ent != NULL) >+ ctxt->nbentities += ent->owner; > if ((ent != NULL) && > (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) { > if (len > buf_size - 10) { >@@ -4844,6 +4858,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt > int isParameter = 0; > xmlChar *orig = NULL; > int skipped; >+ unsigned long oldnbent = ctxt->nbentities; > > /* GROW; done in the caller */ > if (CMP8(CUR_PTR, '<', '!', 'E', 'N', 'T', 'I', 'T', 'Y')) { >@@ -5068,6 +5083,11 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt > } > } > if (cur != NULL) { >+ if ((cur->owner != 0) || (cur->children == NULL)) { >+ cur->owner = ctxt->nbentities - oldnbent; >+ if (cur->owner == 0) >+ cur->owner = 1; >+ } > if (cur->orig != NULL) > xmlFree(orig); > else >@@ -6477,6 +6497,11 @@ xmlParseReference(xmlParserCtxtPtr ctxt) > if (ent == NULL) return; > if (!ctxt->wellFormed) > return; >+ ctxt->nbentities++; >+ if (ctxt->nbentities >= 500000) { >+ xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL); >+ return; >+ } > was_checked = ent->checked; > if ((ent->name != NULL) && > (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) { >@@ -6528,7 +6553,8 @@ xmlParseReference(xmlParserCtxtPtr ctxt) > (ent->children == NULL)) { > ent->children = list; > ent->last = list; >- ent->owner = 1; >+ if (ent->owner == 0) >+ ent->owner = 1; > list->parent = (xmlNodePtr) ent; > } else { > xmlFreeNodeList(list); >@@ -6537,6 +6563,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) > xmlFreeNodeList(list); > } > } else { >+ unsigned long oldnbent = ctxt->nbentities; > /* > * 4.3.2: An internal general parsed entity is well-formed > * if its replacement text matches the production labeled >@@ -6559,6 +6586,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) > ret = xmlParseBalancedChunkMemoryInternal(ctxt, > value, user_data, &list); > ctxt->depth--; >+ > } else if (ent->etype == > XML_EXTERNAL_GENERAL_PARSED_ENTITY) { > ctxt->depth++; >@@ -6571,6 +6599,11 @@ xmlParseReference(xmlParserCtxtPtr ctxt) > xmlErrMsgStr(ctxt, XML_ERR_INTERNAL_ERROR, > "invalid entity type found\n", NULL); > } >+ if ((ent->owner != 0) || (ent->children == NULL)) { >+ ent->owner = ctxt->nbentities - oldnbent; >+ if (ent->owner == 0) >+ ent->owner = 1; >+ } > if (ret == XML_ERR_ENTITY_LOOP) { > xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL); > return; >@@ -6589,7 +6622,8 @@ xmlParseReference(xmlParserCtxtPtr ctxt) > (ctxt->parseMode == XML_PARSE_READER)) { > list->parent = (xmlNodePtr) ent; > list = NULL; >- ent->owner = 1; >+ if (ent->owner == 0) >+ ent->owner = 1; > } else { > ent->owner = 0; > while (list != NULL) { >@@ -6606,7 +6640,8 @@ xmlParseReference(xmlParserCtxtPtr ctxt) > #endif /* LIBXML_LEGACY_ENABLED */ > } > } else { >- ent->owner = 1; >+ if (ent->owner == 0) >+ ent->owner = 1; > while (list != NULL) { > list->parent = (xmlNodePtr) ent; > if (list->next == NULL) >@@ -6629,6 +6664,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) > } > ent->checked = 1; > } >+ ctxt->nbentities += ent->owner; > > if (ent->children == NULL) { > /* >@@ -6783,7 +6819,8 @@ xmlParseReference(xmlParserCtxtPtr ctxt) > break; > cur = next; > } >- ent->owner = 1; >+ if (ent->owner == 0) >+ ent->owner = 1; > #ifdef LIBXML_LEGACY_ENABLED > if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) > xmlAddEntityReference(ent, firstChild, nw); >@@ -11800,7 +11837,7 @@ xmlParseCtxtExternalEntity(xmlParserCtxt > > if (ctx == NULL) return(-1); > >- if (ctx->depth > 40) { >+ if ((ctx->depth > 40) || (ctx->nbentities >= 500000)) { > return(XML_ERR_ENTITY_LOOP); > } > >@@ -12010,7 +12047,8 @@ xmlParseExternalEntityPrivate(xmlDocPtr > xmlChar start[4]; > xmlCharEncoding enc; > >- if (depth > 40) { >+ if ((depth > 40) || >+ ((oldctxt != NULL) && (oldctxt->nbentities >= 500000))) { > return(XML_ERR_ENTITY_LOOP); > } > >@@ -12154,6 +12192,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr > oldctxt->node_seq.maximum = ctxt->node_seq.maximum; > oldctxt->node_seq.length = ctxt->node_seq.length; > oldctxt->node_seq.buffer = ctxt->node_seq.buffer; >+ oldctxt->nbentities += ctxt->nbentities; > ctxt->node_seq.maximum = 0; > ctxt->node_seq.length = 0; > ctxt->node_seq.buffer = NULL; >@@ -12254,7 +12293,7 @@ xmlParseBalancedChunkMemoryInternal(xmlP > int size; > xmlParserErrors ret = XML_ERR_OK; > >- if (oldctxt->depth > 40) { >+ if ((oldctxt->depth > 40) || (oldctxt->nbentities >= 500000)) { > return(XML_ERR_ENTITY_LOOP); > } > >@@ -12379,6 +12418,7 @@ xmlParseBalancedChunkMemoryInternal(xmlP > ctxt->myDoc->last = last; > } > >+ oldctxt->nbentities += ctxt->nbentities; > ctxt->sax = oldsax; > ctxt->dict = NULL; > ctxt->attsDefault = NULL; >@@ -13695,6 +13735,7 @@ xmlCtxtReset(xmlParserCtxtPtr ctxt) > ctxt->depth = 0; > ctxt->charset = XML_CHAR_ENCODING_UTF8; > ctxt->catalogs = NULL; >+ ctxt->nbentities = 0; > xmlInitNodeInfoSeq(&ctxt->node_seq); > > if (ctxt->attsDefault != NULL) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 459830
:
314849
| 314860 |
314862
|
314863
|
314908