[Pkg-libvirt-commits] [libguestfs] 04/36: p2v: Chomp kernel command line (fix) (RHBZ#1229340).
Hilko Bengen
bengen at moszumanska.debian.org
Sun Nov 1 17:13:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag upstream/1.29.47
in repository libguestfs.
commit fc554d422a95f0cef21073a3a8ba0b2d8ddbab45
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Tue Jun 9 14:09:55 2015 +0100
p2v: Chomp kernel command line (fix) (RHBZ#1229340).
Calculate the length of the string, not the length of the buffer.
This fixes commit 6114c10df05cdb1662ac22930010fd45714f9c40.
---
p2v/main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/p2v/main.c b/p2v/main.c
index d322c79..9128bbf 100644
--- a/p2v/main.c
+++ b/p2v/main.c
@@ -534,6 +534,11 @@ read_cmdline (void)
return NULL;
}
+ /* 'len' is not the length of the string, but the length of the
+ * buffer. We need to chomp the string.
+ */
+ len = strlen (ret);
+
if (len >= 1 && ret[len-1] == '\n')
ret[len-1] = '\0';
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list