[commits] [alfred] master: alfred: Fix crash when vis opened empty file (1606d72)

postmaster at open-mesh.org postmaster at open-mesh.org
Mon Sep 9 19:19:37 CEST 2013


Repository : ssh://git@open-mesh.org/alfred

On branch  : master

>---------------------------------------------------------------

commit 1606d72d88515c01941ce919679fcc49c44cc63f
Author: Sven Eckelmann <sven at open-mesh.com>
Date:   Mon Sep 9 17:46:06 2013 +0200

    alfred: Fix crash when vis opened empty file
    
    Signed-off-by: Sven Eckelmann <sven at open-mesh.com>
    Signed-off-by: Simon Wunderlich <simon at open-mesh.com>


>---------------------------------------------------------------

1606d72d88515c01941ce919679fcc49c44cc63f
 vis/vis.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vis/vis.c b/vis/vis.c
index 5e7a109..36ea7fe 100644
--- a/vis/vis.c
+++ b/vis/vis.c
@@ -59,7 +59,8 @@ static char *read_file(char *fname)
 	}
 	fclose(fp);
 
-	buf[size] = 0;
+	if (buf)
+		buf[size] = 0;
 
 	return buf;
 }



More information about the commits mailing list