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

Unified Diff: third_party/libxml/xmlschemastypes.c

Issue 2951008: Update libxml to 2.7.7. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/libxml/xmlschemastypes.c
diff --git a/third_party/libxml/xmlschemastypes.c b/third_party/libxml/xmlschemastypes.c
index 0d967d074132f08f5de740dd6f135eea3d073028..1ce21e10bf14b4b901664b4bb4ed000a69837ef9 100644
--- a/third_party/libxml/xmlschemastypes.c
+++ b/third_party/libxml/xmlschemastypes.c
@@ -2899,12 +2899,23 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
case XML_SCHEMAS_ANYURI:{
if (*value != 0) {
xmlURIPtr uri;
+ xmlChar *tmpval, *cur;
if (normOnTheFly) {
norm = xmlSchemaCollapseString(value);
if (norm != NULL)
value = norm;
}
- uri = xmlParseURI((const char *) value);
+ tmpval = xmlStrdup(value);
+ for (cur = tmpval; *cur; ++cur) {
+ if (*cur < 32 || *cur >= 127 || *cur == ' ' ||
+ *cur == '<' || *cur == '>' || *cur == '"' ||
+ *cur == '{' || *cur == '}' || *cur == '|' ||
+ *cur == '\\' || *cur == '^' || *cur == '`' ||
+ *cur == '\'')
+ *cur = '_';
+ }
+ uri = xmlParseURI((const char *) tmpval);
+ xmlFree(tmpval);
if (uri == NULL)
goto return1;
xmlFreeURI(uri);

Powered by Google App Engine
This is Rietveld 408576698