From c3969e85efe4740b41cf8e262e5637d81f76a3cc Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sat, 29 Oct 2016 21:06:38 +0200 Subject: [PATCH] fix(fontmanager): Add safety check --- include/components/x11/fontmanager.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/components/x11/fontmanager.hpp b/include/components/x11/fontmanager.hpp index 80c6da3a..697c1bac 100644 --- a/include/components/x11/fontmanager.hpp +++ b/include/components/x11/fontmanager.hpp @@ -220,6 +220,8 @@ class fontmanager { } else { if (chr < font->char_min || chr > font->char_max) return false; + if (static_cast(chr - font->char_min) >= font->width_lut.size()) + return false; if (font->width_lut[chr - font->char_min].character_width == 0) return false; return true;