mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-02-06 05:57:39 +03:00
horror around the definition of the lexical values for decimal and derived
* xmlschemastypes.c: horror around the definition of the lexical values for decimal and derived types, fixing to reject empty values, should fix #503268 Daniel svn path=/trunk/; revision=3728
This commit is contained in:
parent
f124539f7a
commit
bfc42632b7
@ -1,3 +1,9 @@
|
||||
Thu Apr 3 12:41:29 CEST 2008 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* xmlschemastypes.c: horror around the definition of the lexical
|
||||
values for decimal and derived types, fixing to reject empty
|
||||
values, should fix #503268
|
||||
|
||||
Thu Apr 3 11:44:57 CEST 2008 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* encoding.c: buffer may not be large enough to convert to
|
||||
|
@ -2063,7 +2063,7 @@ xmlSchemaValAtomicListNode(xmlSchemaTypePtr type, const xmlChar *value,
|
||||
* Parse an unsigned long into 3 fields.
|
||||
*
|
||||
* Returns the number of significant digits in the number or
|
||||
* -1 if overflow of the capacity
|
||||
* -1 if overflow of the capacity and -2 if it's not a number.
|
||||
*/
|
||||
static int
|
||||
xmlSchemaParseUInt(const xmlChar **str, unsigned long *llo,
|
||||
@ -2072,6 +2072,9 @@ xmlSchemaParseUInt(const xmlChar **str, unsigned long *llo,
|
||||
const xmlChar *tmp, *cur = *str;
|
||||
int ret = 0, i = 0;
|
||||
|
||||
if (!((*cur >= '0') && (*cur <= '9')))
|
||||
return(-2);
|
||||
|
||||
while (*cur == '0') { /* ignore leading zeroes */
|
||||
cur++;
|
||||
}
|
||||
@ -3116,7 +3119,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
} else if (*cur == '+')
|
||||
cur++;
|
||||
ret = xmlSchemaParseUInt(&cur, &lo, &mi, &hi);
|
||||
if (ret == -1)
|
||||
if (ret < 0)
|
||||
goto return1;
|
||||
if (normOnTheFly)
|
||||
while IS_WSP_BLANK_CH(*cur) cur++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user