simple bug hunting done during rpm2html and rpmfind integration.

This commit is contained in:
Daniel Veillard 1998-11-13 18:04:35 +00:00
parent 42dc9b30b9
commit 242590ee5d
4 changed files with 21 additions and 9 deletions

View File

@ -1,3 +1,8 @@
Fri Nov 13 13:03:10 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org>
* parser.c, entities.c: simple bug hunting done during rpm2html and
rpmfind integration.
Sun Nov 8 13:11:07 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org>
* parser.[ch]: Added interfaces allowing to specify a SAX

View File

@ -259,6 +259,7 @@ CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input) {
const CHAR *cur = input;
CHAR *out = buffer;
if (input == NULL) return(NULL);
if (buffer == NULL) {
buffer_size = 1000;
buffer = (CHAR *) malloc(buffer_size * sizeof(CHAR));

View File

@ -2941,7 +2941,8 @@ xmlNodePtr xmlParseElement(xmlParserCtxtPtr ctxt) {
if (CUR == '>') NEXT;
else {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt, "Couldn't find end of Start Tag\n%.30s\n",openTag);
ctxt->sax->error(ctxt, "Couldn't find end of Start Tag\n%.30s\n",
openTag);
/*
* end of parsing of this node.
@ -2957,8 +2958,8 @@ xmlNodePtr xmlParseElement(xmlParserCtxtPtr ctxt) {
xmlParseContent(ctxt);
if (!IS_CHAR(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt, "Premature end of data in tag %.30s\n%.30s\n",
openTag);
ctxt->sax->error(ctxt,
"Premature end of data in tag %.30s\n", openTag);
/*
* end of parsing of this node.
@ -3463,7 +3464,7 @@ xmlDocPtr xmlSAXParseDoc(xmlSAXHandlerPtr sax, CHAR *cur) {
return(NULL);
}
xmlInitParserCtxt(ctxt);
if (sax != NULL) ctxt->sax == sax;
if (sax != NULL) ctxt->sax = sax;
input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
if (input == NULL) {
perror("malloc");
@ -3598,7 +3599,7 @@ retry_bigger:
return(NULL);
}
xmlInitParserCtxt(ctxt);
if (sax != NULL) ctxt->sax == sax;
if (sax != NULL) ctxt->sax = sax;
inputStream = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
if (inputStream == NULL) {
perror("malloc");
@ -3674,7 +3675,7 @@ xmlDocPtr xmlSAXParseMemory(xmlSAXHandlerPtr sax, char *buffer, int size) {
return(NULL);
}
xmlInitParserCtxt(ctxt);
if (sax != NULL) ctxt->sax == sax;
if (sax != NULL) ctxt->sax = sax;
input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
if (input == NULL) {
perror("malloc");

11
tree.c
View File

@ -427,7 +427,10 @@ xmlStringLenGetNodeList(xmlDocPtr doc, const CHAR *value, int len) {
* Create a new REFERENCE_REF node
*/
node = xmlNewReference(doc, val);
if (node == NULL) return(ret);
if (node == NULL) {
if (val != NULL) free(val);
return(ret);
}
if (last == NULL)
last = ret = node;
else {
@ -534,9 +537,11 @@ xmlStringGetNodeList(xmlDocPtr doc, const CHAR *value) {
/*
* Create a new REFERENCE_REF node
*/
val = xmlStrndup(q, cur - q);
node = xmlNewReference(doc, val);
if (node == NULL) return(ret);
if (node == NULL) {
if (val != NULL) free(val);
return(ret);
}
if (last == NULL)
last = ret = node;
else {