1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00

small fix fixing bug #58539 reported by coolo, in entity substitution mode

* SAX.c: small fix fixing bug #58539 reported by coolo, in
  entity substitution mode text at the end of the entity might
  be added due to text coalescing.
* nanoftp.c parser.c: small cleanup
Daniel
This commit is contained in:
Daniel Veillard 2001-08-13 10:43:15 +00:00
parent 0c72097505
commit f300b7e701
4 changed files with 15 additions and 8 deletions

View File

@ -1,3 +1,10 @@
Mon Aug 13 12:33:40 CEST 2001 Daniel Veillard <daniel@veillard.com>
* SAX.c: small fix fixing bug #58539 reported by coolo, in
entity substitution mode text at the end of the entity might
be added due to text coalescing.
* nanoftp.c parser.c: small cleanup
Wed Aug 8 22:57:05 CEST 2001 Daniel Veillard <daniel@veillard.com>
* HACKING: added John Fleck right to commit in the doc subdir

8
SAX.c
View File

@ -1307,8 +1307,10 @@ characters(void *ctx, const xmlChar *ch, int len)
}
#endif
} else {
int isText = xmlNodeIsText(lastChild);
if ((isText) && (ctxt->nodemem != 0)) {
int coalesceText = (lastChild != NULL) &&
(lastChild->type == XML_TEXT_NODE) &&
(lastChild->name == xmlStringText);
if ((coalesceText) && (ctxt->nodemem != 0)) {
#ifndef XML_USE_BUFFER_CONTENT
/*
* The whole point of maintaining nodelen and nodemem,
@ -1339,7 +1341,7 @@ characters(void *ctx, const xmlChar *ch, int len)
#else
xmlTextConcat(lastChild, ch, len);
#endif
} else if (isText) {
} else if (coalesceText) {
xmlTextConcat(lastChild, ch, len);
if (ctxt->node->children != NULL) {
ctxt->nodelen = xmlStrlen(lastChild->content);

View File

@ -1220,6 +1220,7 @@ xmlNanoFTPGetConnection(void *ctx) {
struct sockaddr_in dataAddr;
SOCKLEN_T dataAddrLen;
retry:
ctxt->dataFd = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (ctxt->dataFd < 0) {
xmlGenericError(xmlGenericErrorContext,

View File

@ -28,9 +28,6 @@
* See Copyright for the status of this software.
*
* daniel@veillard.com
*
* 14 Nov 2000 ht - truncated definitions of xmlSubstituteEntitiesDefaultValue
* and xmlDoValidityCheckingDefaultValue for VMS
*/
#include "libxml.h"
@ -5470,7 +5467,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
ctxt->errNo = XML_ERR_NAME_REQUIRED;
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"xmlParseEntityRef: no name\n");
"xmlParseStringEntityRef: no name\n");
ctxt->wellFormed = 0;
ctxt->disableSAX = 1;
} else {
@ -5602,7 +5599,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
ctxt->errNo = XML_ERR_ENTITYREF_SEMICOL_MISSING;
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"xmlParseEntityRef: expecting ';'\n");
"xmlParseStringEntityRef: expecting ';'\n");
ctxt->wellFormed = 0;
ctxt->disableSAX = 1;
}