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

[Xen-changelog] [xen master] blktap2: initialise buf in vhd_util_check_footer



commit 01120b223aba0af46d482ac679c467d39d9cad7d
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Fri Apr 29 16:11:15 2016 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Fri May 6 15:50:23 2016 +0100

    blktap2: initialise buf in vhd_util_check_footer
    
    Gcc complains:
    
    vhd-util-check.c: In function â??vhd_util_check_footerâ??:
    vhd-util-check.c:413:2: error: â??bufâ?? may be used uninitialized in this 
function [-Werror=maybe-uninitialized]
      memcpy(&backup, buf, sizeof(backup));
    
    In fact buf is initialised a few lines above.
    
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Reviewed-by: Doug Goldstein <cardoe@xxxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/blktap2/vhd/lib/vhd-util-check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/blktap2/vhd/lib/vhd-util-check.c 
b/tools/blktap2/vhd/lib/vhd-util-check.c
index af07426..40565ac 100644
--- a/tools/blktap2/vhd/lib/vhd-util-check.c
+++ b/tools/blktap2/vhd/lib/vhd-util-check.c
@@ -335,7 +335,7 @@ vhd_util_check_footer(int fd, vhd_footer_t *footer, int 
ignore)
 {
        size_t size;
        int err, opened;
-       char *msg, *buf;
+       char *msg, *buf = NULL;
        off_t eof, off;
        vhd_footer_t primary, backup;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

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