[PATCH] Add missing param initialization in qemuDomainBlockStatsFlags

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

* src/qemu/qemu_driver.c: Fix use of uninitialized 'params'
---
 src/qemu/qemu_driver.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f81cb88..3194e6b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7236,6 +7236,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
     }
 
     if (tmp < *nparams && wr_req != -1) {
+        param = &params[tmp];
         if (virStrcpyStatic(param->field,
                             VIR_DOMAIN_BLOCK_STATS_WRITE_REQ) == NULL) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
@@ -7249,6 +7250,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
     }
 
     if (tmp < *nparams && rd_bytes != -1) {
+        param = &params[tmp];
         if (virStrcpyStatic(param->field,
                             VIR_DOMAIN_BLOCK_STATS_READ_BYTES) == NULL) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
@@ -7262,6 +7264,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
     }
 
     if (tmp < *nparams && rd_req != -1) {
+        param = &params[tmp];
         if (virStrcpyStatic(param->field,
                             VIR_DOMAIN_BLOCK_STATS_READ_REQ) == NULL) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
@@ -7275,6 +7278,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
     }
 
     if (tmp < *nparams && flush_req != -1) {
+        param = &params[tmp];
         if (virStrcpyStatic(param->field,
                             VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ) == NULL) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
@@ -7288,6 +7292,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
     }
 
     if (tmp < *nparams && wr_total_times != -1) {
+        param = &params[tmp];
         if (virStrcpyStatic(param->field,
                             VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES) == NULL) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
@@ -7301,6 +7306,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
     }
 
     if (tmp < *nparams && rd_total_times != -1) {
+        param = &params[tmp];
         if (virStrcpyStatic(param->field,
                             VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES) == NULL) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
@@ -7314,6 +7320,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
     }
 
     if (tmp < *nparams && flush_total_times != -1) {
+        param = &params[tmp];
         if (virStrcpyStatic(param->field,
                             VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES) == NULL) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
-- 
1.7.6.4

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]