]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: console: Fix buffer overflow in cmd 'font list'
authorJanne Grunau <j@jannau.net>
Wed, 17 Jan 2024 22:29:29 +0000 (23:29 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 29 Jan 2024 19:53:11 +0000 (14:53 -0500)
vidconsole_ops.get_font is documented to return -ENOENT after the last
video_fontdata entry.

Signed-off-by: Janne Grunau <j@jannau.net>
drivers/video/console_core.c

index d17764d0b086561349b9227965b8ade0348e6349..939363653f6c1be60f353e959c3db69e053d78b0 100644 (file)
@@ -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)