diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2019-06-05 15:23:48 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2019-06-05 15:23:48 +0000 |
| commit | 24dd375e25618cf330c448e8e58238154f07fac8 (patch) | |
| tree | 660b452d5b97fab58f8af90835f0ce858833dca4 /usr.bin | |
| parent | e4e92b4d5fa81a66d3d2e6c8e67c24faef83dff2 (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/vtfontcvt/vtfontcvt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/vtfontcvt/vtfontcvt.c b/usr.bin/vtfontcvt/vtfontcvt.c index 1e82049872ac2..58bc26938f447 100644 --- a/usr.bin/vtfontcvt/vtfontcvt.c +++ b/usr.bin/vtfontcvt/vtfontcvt.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #define VFNT_MAP_NORMAL_RH 1 #define VFNT_MAP_BOLD 2 #define VFNT_MAP_BOLD_RH 3 +#define VFNT_MAXGLYPHS 131072 #define VFNT_MAXDIMENSION 128 static unsigned int width = 8, wbytes, height = 16; @@ -184,6 +185,8 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, int fallback) SLIST_INSERT_HEAD(&glyph_hash[hash], gl, g_hash); glyph_unique++; + if (glyph_unique > VFNT_MAXGLYPHS) + errx(1, "too many glyphs (%u)", glyph_unique); return (gl); } |
