[Pkg-libvirt-commits] [libvirt] 01/01: xen: fix parsing xend http response

Guido Guenther agx at moszumanska.debian.org
Wed Jan 29 06:32:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to branch master
in repository libvirt.

commit 94096c94a640209c142144b48baceb506dc3f20a
Author: Guido Günther <agx at sigxcpu.org>
Date:   Wed Jan 29 07:31:26 2014 +0100

    xen: fix parsing xend http response
    
    This unbreaks xen on wheezy.
    
    Thanks: Jim Fehlig
---
 debian/patches/series                              |  1 +
 .../xen-fix-parsing-xend-http-response.patch       | 40 ++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index 6148614..0baf1ce 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ Don-t-fail-if-we-can-t-setup-avahi.patch
 Reduce-udevadm-settle-timeout-to-10-seconds.patch
 debian/Debianize-systemd-service-files.patch
 Allow-xen-toolstack-to-find-it-s-binaries.patch
+xen-fix-parsing-xend-http-response.patch
diff --git a/debian/patches/xen-fix-parsing-xend-http-response.patch b/debian/patches/xen-fix-parsing-xend-http-response.patch
new file mode 100644
index 0000000..e993128
--- /dev/null
+++ b/debian/patches/xen-fix-parsing-xend-http-response.patch
@@ -0,0 +1,40 @@
+From: Jim Fehlig <jfehlig at suse.com>
+Date: Tue, 28 Jan 2014 18:15:48 -0700
+Subject: xen: fix parsing xend http response
+
+Commit df36af58 broke parsing of http response from xend.  The prior
+use of atoi() would happily parse e.g. a string containing "200 OK\r\n",
+whereas virStrToLong_i() will fail when called with a NULL end_ptr.
+Change the calls to virStrToLong_i() to provide a non-NULL end_ptr.
+---
+ src/xen/xend_internal.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
+index 87e77a6..25137b8 100644
+--- a/src/xen/xend_internal.c
++++ b/src/xen/xend_internal.c
+@@ -282,6 +282,7 @@ xend_req(int fd, char **content)
+     size_t buffer_size = 4096;
+     int content_length = 0;
+     int retcode = 0;
++    char *end_ptr;
+ 
+     if (VIR_ALLOC_N(buffer, buffer_size) < 0)
+         return -1;
+@@ -291,13 +292,13 @@ xend_req(int fd, char **content)
+             break;
+ 
+         if (istartswith(buffer, "Content-Length: ")) {
+-            if (virStrToLong_i(buffer + 16, NULL, 10, &content_length) < 0) {
++            if (virStrToLong_i(buffer + 16, &end_ptr, 10, &content_length) < 0) {
+                 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("failed to parse Xend response content length"));
+                 return -1;
+             }
+         } else if (istartswith(buffer, "HTTP/1.1 ")) {
+-            if (virStrToLong_i(buffer + 9, NULL, 10, &retcode) < 0) {
++            if (virStrToLong_i(buffer + 9, &end_ptr, 10, &retcode) < 0) {
+                 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("failed to parse Xend response return code"));
+                 return -1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libvirt.git



More information about the Pkg-libvirt-commits mailing list