neilg 2003/12/30 18:34:41
Modified: c/src/xercesc/validators/datatype ListDatatypeValidator.cpp
Log:
fix one more buffer overrun, affecting boolean lists
Revision Changes Path
1.18 +8 -4
xml-xerces/c/src/xercesc/validators/datatype/ListDatatypeValidator.cpp
Index: ListDatatypeValidator.cpp
===================================================================
RCS file:
/home/cvs/xml-xerces/c/src/xercesc/validators/datatype/ListDatatypeValidator.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ListDatatypeValidator.cpp 23 Dec 2003 21:50:36 -0000 1.17
+++ ListDatatypeValidator.cpp 31 Dec 2003 02:34:41 -0000 1.18
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.18 2003/12/31 02:34:41 neilg
+ * fix one more buffer overrun, affecting boolean lists
+ *
* Revision 1.17 2003/12/23 21:50:36 peiyongz
* Absorb exception thrown in getCanonicalRepresentation and return 0,
* only validate when required
@@ -544,11 +547,11 @@
{
// need to resize
XMLCh * oldBuf = retBuf;
- retBuf = (XMLCh*) toUse->allocate(retBufSize * sizeof(XMLCh) * 2);
+ retBuf = (XMLCh*) toUse->allocate(retBufSize * sizeof(XMLCh) * 4);
memcpy(retBuf, oldBuf, retBufSize * sizeof(XMLCh ));
retBufPtr = (retBufPtr - oldBuf) + retBuf;
toUse->deallocate(oldBuf);
- retBufSize <<= 1;
+ retBufSize <<= 2;
}
XMLString::catString(retBufPtr, itemCanRep);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]