From ae8982fe3e71acefb12fe248b4ffd4137b29e8b9 Mon Sep 17 00:00:00 2001 From: Ray Chason Date: Thu, 2 Jul 2026 21:34:35 -0400 Subject: [PATCH] MS-DOS: Check font pointer for null The 16 color mode loads the font specified in font_map, and accepts it only if its size is 8 by 16 pixels. This change avoids a null dereference if the font is not found. --- sys/msdos/vidvga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/msdos/vidvga.c b/sys/msdos/vidvga.c index c69823d74..fb5de8db7 100644 --- a/sys/msdos/vidvga.c +++ b/sys/msdos/vidvga.c @@ -811,7 +811,7 @@ vga_Init(void) } free_font(psf_font); psf_font = load_font(font_name); - if (psf_font->width != 8 || psf_font->height != 16) { + if (psf_font != NULL && psf_font->width != 8 || psf_font->height != 16) { raw_printf("VGA mode only supports 8x16 fonts"); free_font(psf_font); psf_font = NULL;