1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-10 08:58:16 +03:00

Fixed a bug which I invented: hexBinary's string values were not

* xmlschemastypes.c: Fixed a bug which I invented: hexBinary's string
  values were not duplicated corrently when creating a computed value
  in xmlSchemaValAtomicType.
This commit is contained in:
Kasimier T. Buchcik 2005-06-09 13:14:38 +00:00
parent 828f654769
commit 8dd1e1bcad
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,9 @@
Thu Jun 9 15:11:38 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemastypes.c: Fixed a bug which I invented: hexBinary's string
values were not duplicated corrently when creating a computed value
in xmlSchemaValAtomicType.
Thu Jun 9 13:20:57 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemas.c result/schemas/include1_0_0.err:

View File

@ -2742,7 +2742,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
goto return0;
}
case XML_SCHEMAS_HEXBINARY:{
const xmlChar *cur = value;
const xmlChar *cur = value, *start;
xmlChar *base;
int total, i = 0;
@ -2752,6 +2752,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
if (normOnTheFly)
while IS_WSP_BLANK_CH(*cur) cur++;
start = cur;
while (((*cur >= '0') && (*cur <= '9')) ||
((*cur >= 'A') && (*cur <= 'F')) ||
((*cur >= 'a') && (*cur <= 'f'))) {
@ -2775,7 +2776,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
* Copy only the normalized piece.
* CRITICAL TODO: Check this.
*/
cur = xmlStrndup(cur, i);
cur = xmlStrndup(start, i);
if (cur == NULL) {
xmlSchemaTypeErrMemory(node, "allocating hexbin data");
xmlFree(v);