Revised fix for abort occurring with a percent followed by whitespace or

another percent in entity values.
This commit is contained in:
Clark Cooper 2000-10-20 15:14:36 +00:00
parent c4ca6cf75e
commit 809a5d2916
4 changed files with 10 additions and 10 deletions

View file

@ -1,3 +1,5 @@
- Fixed a bug where parameter entities weren't being expanded inside
entity literals.
- Defined XML_SetEndNamespaceDeclHandler. Thanks to Darryl Miles for
finding this oversight.
- Changed default patterns in lib/Makefile.in to fit non-GNU makes

View file

@ -22,7 +22,7 @@ dnl
EXPAT_MAJOR_VERSION=1
EXPAT_MINOR_VERSION=95
EXPAT_EDIT=0
EXPAT_EDIT=1
EXPAT_VERSION=$EXPAT_MAJOR_VERSION.$EXPAT_MINOR_VERSION.$EXPAT_EDIT
VERSION=$EXPAT_VERSION
@ -40,7 +40,7 @@ dnl If the API changes incompatibly set LIBAGE back to 0
dnl
LIBCURRENT=0
LIBREVISION=0
LIBREVISION=1
LIBAGE=0
AC_CONFIG_HEADER(config.h:config.hin)

View file

@ -4,7 +4,7 @@ See the file COPYING for copying permission.
*/
static char RCSId[]
= "$Header: /cvsroot/expat/expat/lib/xmlparse.c,v 1.7 2000/10/09 06:26:10 jclark Exp $";
= "$Header: /cvsroot/expat/expat/lib/xmlparse.c,v 1.8 2000/10/10 18:48:48 coopercc Exp $";
#include <config.h>
@ -3533,11 +3533,6 @@ enum XML_Error storeEntityValue(XML_Parser parser,
return XML_ERROR_NO_MEMORY;
*(pool->ptr)++ = 0xA;
break;
case XML_TOK_PERCENT:
if (pool->end == pool->ptr && !poolGrow(pool))
return XML_ERROR_NO_MEMORY;
*(pool->ptr)++ = '%';
break;
case XML_TOK_CHAR_REF:
{
XML_Char buf[XML_ENCODE_MAX];

View file

@ -1270,8 +1270,11 @@ int PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end
*nextTokPtr = ptr;
return XML_TOK_DATA_CHARS;
case BT_PERCNT:
if (ptr == start)
return PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr);
if (ptr == start) {
int tok = PREFIX(scanPercent)(enc, ptr + MINBPC(enc),
end, nextTokPtr);
return (tok == XML_TOK_PERCENT) ? XML_TOK_INVALID : tok;
}
*nextTokPtr = ptr;
return XML_TOK_DATA_CHARS;
case BT_LF: