aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2006-04-20 14:28:01 +0000
committerDaniel Veillard <veillard@redhat.com>2006-04-20 14:28:01 +0000
commitb68bd23d9b0e1e64212a73cb7412368eee4d9aa4 (patch)
tree038125c50232ea18bc30a7fafd8c904e51379083 /src/xend_internal.c
parent* include/libvirt.h include/libvirt.h.in doc/*: added new entry point (diff)
downloadlibvirt-b68bd23d9b0e1e64212a73cb7412368eee4d9aa4.tar.gz
libvirt-b68bd23d9b0e1e64212a73cb7412368eee4d9aa4.tar.bz2
libvirt-b68bd23d9b0e1e64212a73cb7412368eee4d9aa4.zip
* src/xend_internal.c: fix an uninitialized memory access in error
reporting. Daniel
Diffstat (limited to 'src/xend_internal.c')
-rw-r--r--src/xend_internal.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/xend_internal.c b/src/xend_internal.c
index cb0ef70db..1bea597f4 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -395,9 +395,9 @@ xend_req(int fd, char *content, size_t n_content)
if (0 > (int) ret)
return -1;
- content[nbuf + ret + 1] = '\0';
+ content[nbuf + ret] = 0;
} else {
- content[nbuf + 1] = '\0';
+ content[nbuf] = 0;
}
} else { /* Unable to complete reading header */
content[0] = 0;
@@ -489,6 +489,9 @@ xend_post(virConnectPtr xend, const char *path, const char *ops,
if ((ret < 0) || (ret >= 300)) {
virXendError(NULL, VIR_ERR_POST_FAILED, content);
+ } else if ((ret = 202) && (strstr(content, "failed") != NULL)) {
+ virXendError(NULL, VIR_ERR_POST_FAILED, content);
+ ret = -1;
}
return ret;