diff options
| author | Gordon Tetlow <gordon@FreeBSD.org> | 2018-04-04 05:21:46 +0000 |
|---|---|---|
| committer | Gordon Tetlow <gordon@FreeBSD.org> | 2018-04-04 05:21:46 +0000 |
| commit | 9f6fffc7312725f767237797fffa596826fa36d9 (patch) | |
| tree | e4834b604c4c006bbf47946abd7f0457f9fbad8d | |
| parent | 4887cfe7894618b3879e1eea20f7ff07164521ea (diff) | |
Notes
| -rw-r--r-- | sys/dev/vt/vt_font.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/vt/vt_font.c b/sys/dev/vt/vt_font.c index c51385e3891ca..2a7c94e089875 100644 --- a/sys/dev/vt/vt_font.c +++ b/sys/dev/vt/vt_font.c @@ -44,6 +44,7 @@ static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); /* Some limits to prevent abnormal fonts from being loaded. */ #define VTFONT_MAXMAPPINGS 65536 +#define VTFONT_MAXGLYPHS 131072 #define VTFONT_MAXGLYPHSIZE 2097152 #define VTFONT_MAXDIMENSION 128 @@ -173,7 +174,8 @@ vtfont_load(vfnt_t *f, struct vt_font **ret) /* Make sure the dimensions are valid. */ if (f->width < 1 || f->height < 1) return (EINVAL); - if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION) + if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION || + f->glyph_count > VTFONT_MAXGLYPHS) return (E2BIG); /* Not too many mappings. */ |
