Code

Fix bug in draw_space to not access memory outside the space buffer
authorJonas Fonseca <fonseca@diku.dk>
Sun, 15 Feb 2009 17:10:05 +0000 (18:10 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Sun, 15 Feb 2009 17:10:42 +0000 (18:10 +0100)
tig.c

diff --git a/tig.c b/tig.c
index 148b6b60b1147c130ea7778745011f9cd4646daa..725ace02579782ab55d4b511cfd89c8c8fc2f19d 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -1905,7 +1905,7 @@ draw_space(struct view *view, enum line_type type, int max, int spaces)
        while (spaces > 0) {
                int len = MIN(spaces, sizeof(space) - 1);
 
-               col += draw_chars(view, type, space, spaces, FALSE);
+               col += draw_chars(view, type, space, len, FALSE);
                spaces -= len;
        }