Skip to content

Commit 2e08aa5

Browse files
committed
font-edit: Fix potential overflow
'snprintf' will always overflow; destination buffer has size 10, but size argument is 11.
1 parent a1ba2eb commit 2e08aa5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/font-edit/twin-fedit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static void draw_char(char_t *c)
338338
cairo_set_source_rgb(cr, 0, .5, .5);
339339

340340
cairo_move_to(cr, tx - 2, ty + 3);
341-
snprintf(buf, sizeof(buf) + 1, "%d", i);
341+
snprintf(buf, sizeof(buf), "%d", i);
342342
cairo_show_text(cr, buf);
343343
cairo_restore(cr);
344344
}

0 commit comments

Comments
 (0)