1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-29 21:46:59 +03:00

Fix errors in XSD double validation check

- xmlschemastypes.c: "e" and "E" should not be accespted as is, digits
  are needed
This commit is contained in:
Csaba Raduly 2010-07-28 11:41:23 +02:00 committed by Daniel Veillard
parent f1121c48af
commit 5f8f5e7add

View File

@ -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 == '+'))