aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2009-08-25 17:18:39 +0200
committerDaniel Veillard <veillard@redhat.com>2009-08-25 17:18:39 +0200
commit283d50279d2defbcedc940a4261758afa0fe752b (patch)
tree0acdb1e9953862498b9519fb37f4d56821c71ae0
parenteeb9932990528a2746deebac26d0affdd55245f3 (diff)
downloadandroid_external_libxml2-283d50279d2defbcedc940a4261758afa0fe752b.tar.gz
android_external_libxml2-283d50279d2defbcedc940a4261758afa0fe752b.tar.bz2
android_external_libxml2-283d50279d2defbcedc940a4261758afa0fe752b.zip
587663 Incorrect Attribute-Value Normalization
* parser.c: when replacing entities and that the entity is CDATA and reference entities then white space character in replacement text need to be replaced by 0x20 * result/noent/att10: correct the output of the associated regression test
-rw-r--r--parser.c7
-rw-r--r--result/noent/att102
2 files changed, 7 insertions, 2 deletions
diff --git a/parser.c b/parser.c
index dfdde8fb..0a10b0f1 100644
--- a/parser.c
+++ b/parser.c
@@ -3705,7 +3705,12 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
if (rep != NULL) {
current = rep;
while (*current != 0) { /* non input consuming */
- buf[len++] = *current++;
+ if ((*current == 0xD) || (*current == 0xA) ||
+ (*current == 0x9)) {
+ buf[len++] = 0x20;
+ current++;
+ } else
+ buf[len++] = *current++;
if (len > buf_size - 10) {
growBuffer(buf, 10);
}
diff --git a/result/noent/att10 b/result/noent/att10
index cc1c6b0a..07f0096c 100644
--- a/result/noent/att10
+++ b/result/noent/att10
@@ -10,7 +10,7 @@
]>
<doc>
<tst a="xyz" b=" xyz"/>
-<tst a="&#13;&#13;A&#10; &#10;B&#13;&#10;" b="&#13;&#13;A&#10; &#10;B&#13;&#10;"/>
+<tst a="A B" b=" A B "/>
<tst a="&#13;&#13;A&#10;&#10;B&#13;&#10;" b="&#13;&#13;A&#10;&#10;B&#13;&#10;"/>
<tst a="x y" b=" x y "/>
<tst a="a b" b=" a b "/>