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

[Xen-changelog] [xen master] libxc/xc_sr_save.c: initialise rec.data before free()



commit 5c53c93998e370ab3da0b3d1d12e6bc760224d67
Author:     Joshua Otto <jtotto@xxxxxxxxxxxx>
AuthorDate: Mon Mar 27 05:06:22 2017 -0400
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Wed Mar 29 18:27:49 2017 +0100

    libxc/xc_sr_save.c: initialise rec.data before free()
    
    colo_merge_secondary_dirty_bitmap() unconditionally free()s the .data
    member of its local xc_sr_record structure rec on its exit path.
    However, if the initial call to read_record() fails then this member is
    uninitialised.  Initialise it.
    
    Signed-off-by: Joshua Otto <jtotto@xxxxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxc/xc_sr_save.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index f98c827..ca6913b 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -520,7 +520,7 @@ static int send_memory_live(struct xc_sr_context *ctx)
 static int colo_merge_secondary_dirty_bitmap(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
-    struct xc_sr_record rec;
+    struct xc_sr_record rec = { 0, 0, NULL };
     uint64_t *pfns = NULL;
     uint64_t pfn;
     unsigned count, i;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.