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>
This commit is contained in:
David Herrmann committed 2013-10-18 17:59:34 +02:00
1 parent 2157b039ac
commit 0b37478d3f
1 file changed
+1 -1
+1 -1
View File
@@ -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;