From 873bc77d3d212484b66a1c8665a44f9dd86a2a41 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 1 Jul 2026 14:10:10 +0200 Subject: [PATCH] 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 Reviewed-by: Teddy Astie Reviewed-by: Juergen Gross Acked-by: Anthony PERARD --- 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);