summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-10-18 17:59:34 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2013-10-18 17:59:34 +0200
commit0b37478d3fc73ce8d823a094dc1b9075331bd3ae (patch)
tree9b60a716473c61585e1f47927a54f51b5f55c89c
parent2157b039acffbecd72cd46bef00d37689aadf717 (diff)
downloadkmscon-0b37478d3fc73ce8d823a094dc1b9075331bd3ae.tar.gz
kmscon-0b37478d3fc73ce8d823a094dc1b9075331bd3ae.tar.bz2
kmscon-0b37478d3fc73ce8d823a094dc1b9075331bd3ae.zip
genunifont: fix MAX_DATA_SIZE to be in 8bit range
We only use uint8_t as length-counter so MAX_DATA_SIZE must be <256 to make our length-checks work. This fixes a bug where we read invalid data if someone uses modified genunifont data files. As this just produces garbled glyphs if garbled data is given, this is actually not critical at all. Reported-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--src/genunifont.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/genunifont.c b/src/genunifont.c
index feaa3f4..f98640e 100644
--- a/src/genunifont.c
+++ b/src/genunifont.c
@@ -36,7 +36,7 @@
#include <stdlib.h>
#include <string.h>
-#define MAX_DATA_SIZE 512
+#define MAX_DATA_SIZE 255
struct unifont_glyph {
struct unifont_glyph *next;