diff --git a/ChangeLog b/ChangeLog index 1972d259..e51225f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Nov 13 13:03:10 EST 1998 Daniel Veillard + + * parser.c, entities.c: simple bug hunting done during rpm2html and + rpmfind integration. + Sun Nov 8 13:11:07 EST 1998 Daniel Veillard * parser.[ch]: Added interfaces allowing to specify a SAX diff --git a/entities.c b/entities.c index 07761171..0b418001 100644 --- a/entities.c +++ b/entities.c @@ -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)); diff --git a/parser.c b/parser.c index 5f1c3fff..2b1b0081 100644 --- a/parser.c +++ b/parser.c @@ -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"); diff --git a/tree.c b/tree.c index a477934b..9e71b4df 100644 --- a/tree.c +++ b/tree.c @@ -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 {