mirror of
https://github.com/GNOME/libxml2.git
synced 2025-02-17 18:19:32 +08:00
simple bug hunting done during rpm2html and rpmfind integration.
This commit is contained in:
parent
42dc9b30b9
commit
242590ee5d
@ -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
|
||||
|
@ -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));
|
||||
|
13
parser.c
13
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");
|
||||
|
11
tree.c
11
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user