summaryrefslogtreecommitdiff
path: root/xmlschemastypes.c
diff options
context:
space:
mode:
authorKasimier T. Buchcik <kbuchcik@src.gnome.org>2005-07-06 11:44:51 +0000
committerKasimier T. Buchcik <kbuchcik@src.gnome.org>2005-07-06 11:44:51 +0000
commit6d30ff2c08b381cff003eead71bf1321a0c0feea (patch)
treea2dfbfb3068f0dc054df50e40ede2f1c1d9f3fb3 /xmlschemastypes.c
parent87b3046bc188fd6cea1aad083c6b79017ab70425 (diff)
downloadlibxml2-6d30ff2c08b381cff003eead71bf1321a0c0feea.tar.gz
Fixed bug #309338, reported by Kupriyanov Anotolij. Added a regression
* xmlschemastypes.c: Fixed bug #309338, reported by Kupriyanov Anotolij. * test/schemas/bug309338* result/schemas/bug309338*: Added a regression test for the above bug.
Diffstat (limited to 'xmlschemastypes.c')
-rw-r--r--xmlschemastypes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index d9fee06e..27f7b536 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -2194,7 +2194,8 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
* If a mixed decimal, get rid of trailing zeroes
*/
if (dec != -1) {
- while ((cptr > cval) && (*(cptr-1) == '0')) {
+ while ((len > dec) && (cptr > cval) &&
+ (*(cptr-1) == '0')) {
cptr--;
len--;
}