Skip to content

Commit

Permalink
vt: fix splash_cpu logos use of vd_drawrect
Browse files Browse the repository at this point in the history
In the (extremely unlikely) case of vd->vd_height ==
vt_logo_sprite_height the vd_drawrect code would write outside of
frame-buffer memory.

MFC after:	1 week
Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D34220

(cherry picked from commit 06296f7)
  • Loading branch information
sg2342 authored and emaste committed Feb 16, 2022
1 parent bf02faa commit 5fed793
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/dev/vt/vt_cpulogos.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ vtterm_draw_cpu_logos(struct vt_device *vd)

a = teken_get_curattr(&tm->tm_emulator);
if (vd->vd_driver->vd_drawrect)
vd->vd_driver->vd_drawrect(vd, 0, 0, vd->vd_width,
vt_logo_sprite_height, 1, a->ta_bgcolor);
vd->vd_driver->vd_drawrect(vd, 0, 0, vd->vd_width - 1,
vt_logo_sprite_height - 1, 1, a->ta_bgcolor);
/*
* Blank is okay because we only ever draw beasties on full screen
* refreshes.
Expand Down

0 comments on commit 5fed793

Please sign in to comment.