mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
* src/internal.h src/xend_internal.c src/xml.c: applied 2 bug fixes
from Shigeki Sakamoto about large buffers. Daniel
This commit is contained in:
parent
e826f73647
commit
b371d037b2
@ -1,3 +1,8 @@
|
||||
Mon Apr 23 09:38:16 CEST 2007 Daniel Veillard <veillard@redhat.com>
|
||||
|
||||
* src/internal.h src/xend_internal.c src/xml.c: applied 2 bug fixes
|
||||
from Shigeki Sakamoto about large buffers.
|
||||
|
||||
Thu Apr 19 12:09:15 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
||||
|
||||
* docs/libvirt.rng: fix duplicate x86_64 arch
|
||||
|
@ -105,6 +105,11 @@ extern "C" {
|
||||
*/
|
||||
#define VIR_CONNECT_RO 1
|
||||
|
||||
/**
|
||||
* buffer size for definition file
|
||||
*/
|
||||
#define VIR_XML_STRING_BUFLEN (1024 + PATH_MAX * 16 + FILENAME_MAX * 16)
|
||||
|
||||
/**
|
||||
* _virConnect:
|
||||
*
|
||||
|
@ -587,7 +587,7 @@ static int
|
||||
xend_op_ext2(virConnectPtr xend, const char *path, char *error,
|
||||
size_t n_error, const char *key, va_list ap)
|
||||
{
|
||||
char ops[1024];
|
||||
char ops[VIR_XML_STRING_BUFLEN];
|
||||
const char *k = key, *v;
|
||||
int offset = 0;
|
||||
|
||||
|
13
src/xml.c
13
src/xml.c
@ -1165,7 +1165,7 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name, int
|
||||
{
|
||||
xmlDocPtr xml = NULL;
|
||||
xmlNodePtr node;
|
||||
char *ret = NULL, *nam = NULL;
|
||||
char *nam = NULL;
|
||||
virBuffer buf;
|
||||
xmlChar *prop;
|
||||
xmlParserCtxtPtr pctxt;
|
||||
@ -1182,10 +1182,9 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name, int
|
||||
|
||||
if (name != NULL)
|
||||
*name = NULL;
|
||||
ret = malloc(1000);
|
||||
if (ret == NULL)
|
||||
buf.content = malloc(1000);
|
||||
if (buf.content == NULL)
|
||||
return (NULL);
|
||||
buf.content = ret;
|
||||
buf.size = 1000;
|
||||
buf.use = 0;
|
||||
|
||||
@ -1376,7 +1375,7 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name, int
|
||||
else
|
||||
free(nam);
|
||||
|
||||
return (ret);
|
||||
return (buf.content);
|
||||
|
||||
error:
|
||||
if (nam != NULL)
|
||||
@ -1389,8 +1388,8 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name, int
|
||||
xmlFreeDoc(xml);
|
||||
if (pctxt != NULL)
|
||||
xmlFreeParserCtxt(pctxt);
|
||||
if (ret != NULL)
|
||||
free(ret);
|
||||
if (buf.content != NULL)
|
||||
free(buf.content);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user