From: Daniel P. Berrange Date: Thu, 2 May 2013 11:35:47 +0000 (+0100) Subject: Fix potential use of undefined variable in remote dispatch code X-Git-Tag: CVE-2013-1962~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31dbbb667f7c711a18bd106358226685674c0605;p=thirdparty%2Flibvirt.git Fix potential use of undefined variable in remote dispatch code If an early dispatch check caused a jump to the 'cleanup' branch then virTypeParamsFree() would be called with an uninitialized 'nparams' variable. Fortunately 'params' is initialized to NULL, so the uninitialized 'nparams' variable would not be used. Signed-off-by: Daniel P. Berrange --- diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index 7b930621de..8d3b013ac0 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -495,7 +495,7 @@ elsif ($mode eq "server") { push(@args_list, "args->$1.$1_len"); } elsif ($args_member =~ m/^remote_typed_param (\S+)<(\S+)>;/) { push(@vars_list, "virTypedParameterPtr $1 = NULL"); - push(@vars_list, "int n$1"); + push(@vars_list, "int n$1 = 0;"); if ($call->{ProcName} eq "NodeSetMemoryParameters") { push(@args_list, "priv->conn"); }