It seems overdue to bump to expat 2.0.1. The attached seems to be the delta we (win and netware) likely care about to resolve significant defects in 2.0.1 (straight from their cvs tree, ignoring highly unusual platforms, and gratuitous whitespace changes).
My inclination is to build for 2.4 using the 'stock' expat .dll of this plus 2.0.1 base distribution, irrespective of the sources shipped in srclib/apr-util/xml/expat since 1.95 is far from current. This is likely to make interop easier for anyone working with modern perl/python/php/etc. I would also jump up to openssl 1.0.0x (current), zlib 1.2.5 (although I detest its 64 bit off_t handling, which is a seperate discussion already started on another list) and drop apr_iconv altogether, which means also dropping the compilation of mod_charset_lite - I believe no other modules would be affected by this change. Comments?
Index: lib/xmltok_impl.c =================================================================== --- lib/xmltok_impl.c (.../2.0.1) (revision 6559) +++ lib/xmltok_impl.c (.../2.0.1-s2.1) (revision 6559) @@ -1744,7 +1744,7 @@ const char *end, POSITION *pos) { - while (ptr != end) { + while (ptr < end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ Index: lib/xmlparse.c =================================================================== --- lib/xmlparse.c (.../2.0.1) (revision 6559) +++ lib/xmlparse.c (.../2.0.1-s2.1) (revision 6559) @@ -1513,15 +1513,11 @@ : (char *)REALLOC(buffer, len * 2)); if (temp == NULL) { errorCode = XML_ERROR_NO_MEMORY; - return XML_STATUS_ERROR; - } - buffer = temp; - if (!buffer) { - errorCode = XML_ERROR_NO_MEMORY; eventPtr = eventEndPtr = NULL; processor = errorProcessor; return XML_STATUS_ERROR; } + buffer = temp; bufferLim = buffer + len * 2; } memcpy(buffer, end, nLeftOver); @@ -1672,6 +1668,8 @@ bufferPtr = buffer = newBuf; #endif /* not defined XML_CONTEXT_BYTES */ } + eventPtr = eventEndPtr = NULL; + positionPtr = NULL; } return bufferEnd; } @@ -3703,6 +3701,9 @@ return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; + case -XML_TOK_PROLOG_S: + tok = -tok; + break; case XML_TOK_NONE: #ifdef XML_DTD /* for internal PE NOT referenced between declarations */ @@ -3782,15 +3783,17 @@ #endif /* XML_DTD */ dtd->hasParamEntityRefs = XML_TRUE; if (startDoctypeDeclHandler) { + XML_Char *pubId; if (!XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_PUBLICID; - doctypePubid = poolStoreString(&tempPool, enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!doctypePubid) + pubId = poolStoreString(&tempPool, enc, + s + enc->minBytesPerChar, + next - enc->minBytesPerChar); + if (!pubId) return XML_ERROR_NO_MEMORY; - normalizePublicId((XML_Char *)doctypePubid); + normalizePublicId(pubId); poolFinish(&tempPool); + doctypePubid = pubId; handleDefault = XML_FALSE; goto alreadyChecked; } @@ -4947,7 +4950,7 @@ if (!entity->textPtr) { if (enc == encoding) eventPtr = ptr; - return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF; + return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF; } else { enum XML_Error result; @@ -6119,12 +6122,13 @@ } if (pool->blocks && pool->start == pool->blocks->s) { int blockSize = (int)(pool->end - pool->start)*2; - pool->blocks = (BLOCK *) + BLOCK *temp = (BLOCK *) pool->mem->realloc_fcn(pool->blocks, (offsetof(BLOCK, s) + blockSize * sizeof(XML_Char))); - if (pool->blocks == NULL) + if (temp == NULL) return XML_FALSE; + pool->blocks = temp; pool->blocks->size = blockSize; pool->ptr = pool->blocks->s + (pool->ptr - pool->start); pool->start = pool->blocks->s;