Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libvirt
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Libvirt Packaging Team
libvirt
Commits
94096c94
Commit
94096c94
authored
11 years ago
by
Guido Günther
Browse files
Options
Downloads
Patches
Plain Diff
xen: fix parsing xend http response
This unbreaks xen on wheezy. Thanks: Jim Fehlig
parent
e936a7eb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
debian/patches/xen-fix-parsing-xend-http-response.patch
+40
-0
40 additions, 0 deletions
debian/patches/xen-fix-parsing-xend-http-response.patch
with
41 additions
and
0 deletions
debian/patches/series
+
1
−
0
View file @
94096c94
...
...
@@ -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
This diff is collapsed.
Click to expand it.
debian/patches/xen-fix-parsing-xend-http-response.patch
0 → 100644
+
40
−
0
View file @
94096c94
From: Jim Fehlig <jfehlig@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;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment