[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] libxc: adjust string size calculations in xc_{,de,test_}assign_dt_device()



commit 873bc77d3d212484b66a1c8665a44f9dd86a2a41
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Jul 1 14:10:10 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jul 1 14:10:10 2026 +0200

    libxc: adjust string size calculations in xc_{,de,test_}assign_dt_device()
    
    In preparation for a hypervisor change also include the nul terminator in
    the size calculations.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 tools/libs/ctrl/xc_domain.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c
index 01c0669c88..94cfab0fa1 100644
--- a/tools/libs/ctrl/xc_domain.c
+++ b/tools/libs/ctrl/xc_domain.c
@@ -1592,7 +1592,7 @@ int xc_assign_dt_device(
     char *path)
 {
     int rc;
-    size_t size = strlen(path);
+    size_t size = strlen(path) + 1;
     struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(path, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
@@ -1624,7 +1624,7 @@ int xc_test_assign_dt_device(
     char *path)
 {
     int rc;
-    size_t size = strlen(path);
+    size_t size = strlen(path) + 1;
     struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(path, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
@@ -1652,7 +1652,7 @@ int xc_deassign_dt_device(
     char *path)
 {
     int rc;
-    size_t size = strlen(path);
+    size_t size = strlen(path) + 1;
     struct xen_domctl domctl = {};
     DECLARE_HYPERCALL_BOUNCE(path, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.