[libvirt] [perl-Sys-Virt][PATCH] Fix memory corruption when calling migrate_to_uri

Hao Liu hliu at redhat.com
Tue Dec 9 05:09:27 UTC 2014


The variable `nparams` didn't change accordingly when adding a new
parameter in commit b2cecf73.

This patch fixes https://bugzilla.redhat.com/show_bug.cgi?id=1171938

Signed-off-by: Hao Liu <hliu at redhat.com>
---
 Virt.xs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Virt.xs b/Virt.xs
index 763a117..688b0d7 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -4342,7 +4342,7 @@ _migrate_to_uri(dom, desturi, newparams, flags=0)
      virTypedParameter *params;
      int nparams;
   PPCODE:
-     nparams = 5;
+     nparams = 6;
      Newx(params, nparams, virTypedParameter);
 
      strncpy(params[0].field, VIR_MIGRATE_PARAM_URI,
-- 
1.8.3.1




More information about the libvir-list mailing list