Skip to content

Commit

Permalink
font-edit: Fix potential overflow
Browse files Browse the repository at this point in the history
'snprintf' will always overflow; destination buffer has size 10, but
size argument is 11.
  • Loading branch information
jserv committed Aug 7, 2024
1 parent a1ba2eb commit 2e08aa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/font-edit/twin-fedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static void draw_char(char_t *c)
cairo_set_source_rgb(cr, 0, .5, .5);

cairo_move_to(cr, tx - 2, ty + 3);
snprintf(buf, sizeof(buf) + 1, "%d", i);
snprintf(buf, sizeof(buf), "%d", i);
cairo_show_text(cr, buf);
cairo_restore(cr);
}
Expand Down

0 comments on commit 2e08aa5

Please sign in to comment.