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

[Xen-changelog] [qemu-upstream-unstable] block: Fix regression for MinGW (assertion caused by short string)



commit 89c9bc3d147fdaa932db99b0463b4af1d3e7cda1
Author: Stefan Weil <sw@xxxxxxxxxxx>
Date:   Thu Nov 22 07:25:48 2012 +0100

    block: Fix regression for MinGW (assertion caused by short string)
    
    The local string tmp_filename is passed to function get_tmp_filename
    which expects a string with minimum size MAX_PATH for w32 hosts.
    
    MAX_PATH is 260 and PATH_MAX is 259, so tmp_filename was too short.
    
    Commit eba25057b9a5e19d10ace2bc7716667a31297169 introduced this
    regression.
    
    Signed-off-by: Stefan Weil <sw@xxxxxxxxxxx>
    Reviewed-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
    Signed-off-by: Blue Swirl <blauwirbel@xxxxxxxxx>
---
 block.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/block.c b/block.c
index 854ebd6..c05875f 100644
--- a/block.c
+++ b/block.c
@@ -787,7 +787,8 @@ int bdrv_open(BlockDriverState *bs, const char *filename, 
int flags,
               BlockDriver *drv)
 {
     int ret;
-    char tmp_filename[PATH_MAX];
+    /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
+    char tmp_filename[PATH_MAX + 1];
 
     if (flags & BDRV_O_SNAPSHOT) {
         BlockDriverState *bs1;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
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®.