[libvirt] [PATCH] fix a bug in remoteSerializeTypedParameters

2011-11-16 Thread Hu Tao
This is a fatal typo believed to be very likely to happen when using
both i and j at the same time for indexing.
---
 daemon/remote.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/daemon/remote.c b/daemon/remote.c
index 857835e..97c9538 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -710,7 +710,7 @@ remoteSerializeTypedParameters(virTypedParameterPtr params,
 goto cleanup;
 }
 val[j].value.type = params[i].type;
-switch (params[j].type) {
+switch (params[i].type) {
 case VIR_TYPED_PARAM_INT:
 val[j].value.remote_typed_param_value_u.i = params[i].value.i;
 break;
-- 
1.7.3.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] fix a bug in remoteSerializeTypedParameters

2011-11-16 Thread Eric Blake
On 11/16/2011 01:38 AM, Hu Tao wrote:
 This is a fatal typo believed to be very likely to happen when using
 both i and j at the same time for indexing.

Yep, and thanks for catching it.

 ---
  daemon/remote.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/daemon/remote.c b/daemon/remote.c
 index 857835e..97c9538 100644
 --- a/daemon/remote.c
 +++ b/daemon/remote.c
 @@ -710,7 +710,7 @@ remoteSerializeTypedParameters(virTypedParameterPtr 
 params,
  goto cleanup;
  }
  val[j].value.type = params[i].type;
 -switch (params[j].type) {
 +switch (params[i].type) {

ACK and pushed.

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list