summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJanne Grunau <j@jannau.net>2024-01-17 23:29:29 +0100
committerTom Rini <trini@konsulko.com>2024-01-29 14:53:11 -0500
commit24adbee344b2d6e8342f41928c82719187dbce09 (patch)
tree988a8b9655378ef904f4e02a29ad7c29b5d45650 /drivers
parent3883c9add00bd0413ff98b542fce0a29029ff172 (diff)
downloadu-boot-24adbee344b2d6e8342f41928c82719187dbce09.tar.gz
u-boot-24adbee344b2d6e8342f41928c82719187dbce09.tar.bz2
u-boot-24adbee344b2d6e8342f41928c82719187dbce09.zip
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 <j@jannau.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/console_core.c2
1 files changed, 1 insertions, 1 deletions
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)