Skip to content

Commit 24adbee

Browse files
jannautrini
authored andcommitted
video: console: Fix buffer overflow in cmd 'font list'
vidconsole_ops.get_font is documented to return -ENOENT after the last video_fontdata entry. Signed-off-by: Janne Grunau <[email protected]>
1 parent 3883c9a commit 24adbee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/video/console_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ int console_simple_get_font(struct udevice *dev, int seq, struct vidfont_info *i
225225
{
226226
info->name = fonts[seq].name;
227227

228-
return 0;
228+
return info->name ? 0 : -ENOENT;
229229
}
230230

231231
int console_simple_select_font(struct udevice *dev, const char *name, uint size)

0 commit comments

Comments
 (0)