]> xenbits.xensource.com Git - libvirt.git/commitdiff
* src/xend_internal.c: fix an uninitialized memory access in error
authorDaniel Veillard <veillard@redhat.com>
Thu, 20 Apr 2006 14:28:01 +0000 (14:28 +0000)
committerDaniel Veillard <veillard@redhat.com>
Thu, 20 Apr 2006 14:28:01 +0000 (14:28 +0000)
  reporting.
Daniel

ChangeLog
src/xend_internal.c

index 95dcb79595d2b1209e7d3ecaaaa3986172f67c1b..bfbb11928e95519741720518e8bbd0cf3b4e21f7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Apr 20 14:31:13 EDT 2006 Daniel Veillard <veillard@redhat.com>
+
+       * src/xend_internal.c: fix an uninitialized memory access in error
+         reporting.
+
 Thu Apr 13 17:19:25 EDT 2006 Daniel Veillard <veillard@redhat.com>
 
        * include/libvirt.h include/libvirt.h.in doc/*: added new entry point
index cb0ef70db26e883f6c801ffae5a7c33c577de8f2..1bea597f46fcbbdc5a25ecc476d3c20a17c0a74f 100644 (file)
@@ -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;