From: Janne Grunau Date: Wed, 17 Jan 2024 22:29:29 +0000 (+0100) Subject: video: console: Fix buffer overflow in cmd 'font list' X-Git-Url: http://git.dujemihanovic.xyz/img/%7B%7B%20%24style.RelPermalink%20%7D%7D?a=commitdiff_plain;h=24adbee344b2d6e8342f41928c82719187dbce09;p=u-boot.git 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 --- diff --git a/drivers/video/console_core.c b/drivers/video/console_core.c index d17764d0b0..939363653f 100644 --- a/drivers/video/console_core.c +++ b/drivers/video/console_core.c @@ -225,7 +225,7 @@ int console_simple_get_font(struct udevice *dev, int seq, struct vidfont_info *i { info->name = fonts[seq].name; - return 0; + return info->name ? 0 : -ENOENT; } int console_simple_select_font(struct udevice *dev, const char *name, uint size)