[Pkg-libvirt-commits] [libguestfs] 15/26: p2v: Chomp kernel command line (fix) (RHBZ#1229340).

Hilko Bengen bengen at moszumanska.debian.org
Sun Nov 1 17:11:27 UTC 2015


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

bengen pushed a commit to annotated tag upstream/1.28.12
in repository libguestfs.

commit 703b60fbfc566f646aa6c1301d0c0ccf29b156a4
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.
    
    (cherry picked from commit fc554d422a95f0cef21073a3a8ba0b2d8ddbab45)
---
 p2v/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/p2v/main.c b/p2v/main.c
index 2ecc443..75fd8d4 100644
--- a/p2v/main.c
+++ b/p2v/main.c
@@ -517,6 +517,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