1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-30 22:43:14 +03:00

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> Sun Nov 8 13:11:07 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org>
* parser.[ch]: Added interfaces allowing to specify a SAX * 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; const CHAR *cur = input;
CHAR *out = buffer; CHAR *out = buffer;
if (input == NULL) return(NULL);
if (buffer == NULL) { if (buffer == NULL) {
buffer_size = 1000; buffer_size = 1000;
buffer = (CHAR *) malloc(buffer_size * sizeof(CHAR)); buffer = (CHAR *) malloc(buffer_size * sizeof(CHAR));

View File

@ -2941,7 +2941,8 @@ xmlNodePtr xmlParseElement(xmlParserCtxtPtr ctxt) {
if (CUR == '>') NEXT; if (CUR == '>') NEXT;
else { else {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) 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. * end of parsing of this node.
@ -2957,8 +2958,8 @@ xmlNodePtr xmlParseElement(xmlParserCtxtPtr ctxt) {
xmlParseContent(ctxt); xmlParseContent(ctxt);
if (!IS_CHAR(CUR)) { if (!IS_CHAR(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt, "Premature end of data in tag %.30s\n%.30s\n", ctxt->sax->error(ctxt,
openTag); "Premature end of data in tag %.30s\n", openTag);
/* /*
* end of parsing of this node. * end of parsing of this node.
@ -3463,7 +3464,7 @@ xmlDocPtr xmlSAXParseDoc(xmlSAXHandlerPtr sax, CHAR *cur) {
return(NULL); return(NULL);
} }
xmlInitParserCtxt(ctxt); xmlInitParserCtxt(ctxt);
if (sax != NULL) ctxt->sax == sax; if (sax != NULL) ctxt->sax = sax;
input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput)); input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
if (input == NULL) { if (input == NULL) {
perror("malloc"); perror("malloc");
@ -3598,7 +3599,7 @@ retry_bigger:
return(NULL); return(NULL);
} }
xmlInitParserCtxt(ctxt); xmlInitParserCtxt(ctxt);
if (sax != NULL) ctxt->sax == sax; if (sax != NULL) ctxt->sax = sax;
inputStream = (xmlParserInputPtr) malloc(sizeof(xmlParserInput)); inputStream = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
if (inputStream == NULL) { if (inputStream == NULL) {
perror("malloc"); perror("malloc");
@ -3674,7 +3675,7 @@ xmlDocPtr xmlSAXParseMemory(xmlSAXHandlerPtr sax, char *buffer, int size) {
return(NULL); return(NULL);
} }
xmlInitParserCtxt(ctxt); xmlInitParserCtxt(ctxt);
if (sax != NULL) ctxt->sax == sax; if (sax != NULL) ctxt->sax = sax;
input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput)); input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
if (input == NULL) { if (input == NULL) {
perror("malloc"); 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 * Create a new REFERENCE_REF node
*/ */
node = xmlNewReference(doc, val); node = xmlNewReference(doc, val);
if (node == NULL) return(ret); if (node == NULL) {
if (val != NULL) free(val);
return(ret);
}
if (last == NULL) if (last == NULL)
last = ret = node; last = ret = node;
else { else {
@ -534,9 +537,11 @@ xmlStringGetNodeList(xmlDocPtr doc, const CHAR *value) {
/* /*
* Create a new REFERENCE_REF node * Create a new REFERENCE_REF node
*/ */
val = xmlStrndup(q, cur - q);
node = xmlNewReference(doc, val); node = xmlNewReference(doc, val);
if (node == NULL) return(ret); if (node == NULL) {
if (val != NULL) free(val);
return(ret);
}
if (last == NULL) if (last == NULL)
last = ret = node; last = ret = node;
else { else {