Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: third_party/libxml/src/include/libxml/entities.h

Issue 2539003002: Make the XML entity recursion check more precise. (Closed)
Patch Set: Feedback. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/libxml/src/entities.c ('k') | third_party/libxml/src/parser.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Summary: interface for the XML entities handling 2 * Summary: interface for the XML entities handling
3 * Description: this module provides some of the entity API needed 3 * Description: this module provides some of the entity API needed
4 * for the parser and applications. 4 * for the parser and applications.
5 * 5 *
6 * Copy: See Copyright for the status of this software. 6 * Copy: See Copyright for the status of this software.
7 * 7 *
8 * Author: Daniel Veillard 8 * Author: Daniel Veillard
9 */ 9 */
10 10
(...skipping 17 matching lines...) Expand all
28 XML_INTERNAL_PARAMETER_ENTITY = 4, 28 XML_INTERNAL_PARAMETER_ENTITY = 4,
29 XML_EXTERNAL_PARAMETER_ENTITY = 5, 29 XML_EXTERNAL_PARAMETER_ENTITY = 5,
30 XML_INTERNAL_PREDEFINED_ENTITY = 6 30 XML_INTERNAL_PREDEFINED_ENTITY = 6
31 } xmlEntityType; 31 } xmlEntityType;
32 32
33 /* 33 /*
34 * An unit of storage for an entity, contains the string, the value 34 * An unit of storage for an entity, contains the string, the value
35 * and the linkind data needed for the linking in the hash table. 35 * and the linkind data needed for the linking in the hash table.
36 */ 36 */
37 37
38 typedef enum {
39 XML_ENTITY_NOT_BEING_CHECKED,
40 XML_ENTITY_BEING_CHECKED /* entity check is in progress */
41 } xmlEntityRecursionGuard;
42
38 struct _xmlEntity { 43 struct _xmlEntity {
39 void *_private;» /* application data */ 44 void *_private;» /* application data */
40 xmlElementType type; /* XML_ENTITY_DECL, must be second ! */ 45 xmlElementType type; /* XML_ENTITY_DECL, must be second ! */
41 const xmlChar *name; /* Entity name */ 46 const xmlChar *name; /* Entity name */
42 struct _xmlNode *children; /* First child link */ 47 struct _xmlNode *children; /* First child link */
43 struct _xmlNode *last; /* Last child link */ 48 struct _xmlNode *last; /* Last child link */
44 struct _xmlDtd *parent; /* -> DTD */ 49 struct _xmlDtd *parent; /* -> DTD */
45 struct _xmlNode *next; /* next sibling link */ 50 struct _xmlNode *next; /* next sibling link */
46 struct _xmlNode *prev; /* previous sibling link */ 51 struct _xmlNode *prev; /* previous sibling link */
47 struct _xmlDoc *doc; /* the containing document */ 52 struct _xmlDoc *doc; /* the containing document */
48 53
49 xmlChar *orig; /* content without ref substitution */ 54 xmlChar *orig; /* content without ref substitution */
50 xmlChar *content; /* content or ndata if unparsed */ 55 xmlChar *content; /* content or ndata if unparsed */
51 int length; /* the content length */ 56 int length; /* the content length */
52 xmlEntityType etype; /* The entity type */ 57 xmlEntityType etype; /* The entity type */
53 const xmlChar *ExternalID; /* External identifier for PUBLIC */ 58 const xmlChar *ExternalID; /* External identifier for PUBLIC */
54 const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */ 59 const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
55 60
56 struct _xmlEntity *nexte; /* unused */ 61 struct _xmlEntity *nexte; /* unused */
57 const xmlChar *URI; /* the full URI as computed */ 62 const xmlChar *URI; /* the full URI as computed */
58 int owner; /* does the entity own the childrens */ 63 int owner; /* does the entity own the childrens */
59 int»» » checked;» /* was the entity content checked */ 64 int checked;» /* was the entity content checked and */
60 » » » » » /* this is also used to count entities 65 » » » » » /* l.o. bit: replacement contains '<' */
61 » » » » » * references done from that entity 66 » » » » » /* remaining bits: one plus count of */
62 » » » » » * and if it contains '<' */ 67 /* entity references from this entity */
68 xmlEntityRecursionGuard guard;
63 }; 69 };
64 70
65 /* 71 /*
66 * All entities are stored in an hash table. 72 * All entities are stored in an hash table.
67 * There is 2 separate hash tables for global and parameter entities. 73 * There is 2 separate hash tables for global and parameter entities.
68 */ 74 */
69 75
70 typedef struct _xmlHashTable xmlEntitiesTable; 76 typedef struct _xmlHashTable xmlEntitiesTable;
71 typedef xmlEntitiesTable *xmlEntitiesTablePtr; 77 typedef xmlEntitiesTable *xmlEntitiesTablePtr;
72 78
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 XMLPUBFUN void XMLCALL 148 XMLPUBFUN void XMLCALL
143 xmlCleanupPredefinedEntities(void); 149 xmlCleanupPredefinedEntities(void);
144 #endif /* LIBXML_LEGACY_ENABLED */ 150 #endif /* LIBXML_LEGACY_ENABLED */
145 151
146 152
147 #ifdef __cplusplus 153 #ifdef __cplusplus
148 } 154 }
149 #endif 155 #endif
150 156
151 # endif /* __XML_ENTITIES_H__ */ 157 # endif /* __XML_ENTITIES_H__ */
OLDNEW
« no previous file with comments | « third_party/libxml/src/entities.c ('k') | third_party/libxml/src/parser.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698