[libxml2] Fix errors in XSD double validation check
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Fix errors in XSD double validation check
- Date: Wed, 28 Jul 2010 09:43:01 +0000 (UTC)
commit 5f8f5e7add065dc569b999179ff25e475376a901
Author: Csaba Raduly <rcsaba gmail com>
Date: Wed Jul 28 11:41:23 2010 +0200
Fix errors in XSD double validation check
- xmlschemastypes.c: "e" and "E" should not be accespted as is, digits
are needed
xmlschemastypes.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 1ce21e1..5347283 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 == '+'))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]