diff options
author | Csaba Raduly <rcsaba@gmail.com> | 2010-07-28 11:41:23 +0200 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2010-07-28 11:41:23 +0200 |
commit | 5f8f5e7add065dc569b999179ff25e475376a901 (patch) | |
tree | 63d91b7c6ac0b641b47d97c38bd864a21e620d55 /xmlschemastypes.c | |
parent | f1121c48afd5ff8fb9cfc2ea8b33a77586bc370e (diff) | |
download | android_external_libxml2-5f8f5e7add065dc569b999179ff25e475376a901.tar.gz android_external_libxml2-5f8f5e7add065dc569b999179ff25e475376a901.tar.bz2 android_external_libxml2-5f8f5e7add065dc569b999179ff25e475376a901.zip |
Fix errors in XSD double validation check
- xmlschemastypes.c: "e" and "E" should not be accespted as is, digits
are needed
Diffstat (limited to 'xmlschemastypes.c')
-rw-r--r-- | xmlschemastypes.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/xmlschemastypes.c b/xmlschemastypes.c index 1ce21e10..53472837 100644 --- a/xmlschemastypes.c +++ b/xmlschemastypes.c @@ -2389,9 +2389,11 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, normOnTheFly); break; case XML_SCHEMAS_FLOAT: - case XML_SCHEMAS_DOUBLE:{ + case XML_SCHEMAS_DOUBLE: { const xmlChar *cur = value; int neg = 0; + int digits_before = 0; + int digits_after = 0; if (normOnTheFly) while IS_WSP_BLANK_CH(*cur) cur++; @@ -2464,12 +2466,17 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, goto return1; while ((*cur >= '0') && (*cur <= '9')) { cur++; + digits_before++; } if (*cur == '.') { cur++; - while ((*cur >= '0') && (*cur <= '9')) + while ((*cur >= '0') && (*cur <= '9')) { cur++; + digits_after++; + } } + if (digits_before + digits_after == 0) + goto return1; if ((*cur == 'e') || (*cur == 'E')) { cur++; if ((*cur == '-') || (*cur == '+')) |