diff options
author | marha <marha@users.sourceforge.net> | 2014-06-08 15:03:35 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-06-08 15:03:35 +0200 |
commit | d435b20322433b335a4fc5693cce0399a3f27b2d (patch) | |
tree | 8d96b388ee1058340a9d7c1a3c4096169ac3839f /libXfont/src/fontfile/fontdir.c | |
parent | 2614b017fb8a28f360897ece66815934fd1562f5 (diff) | |
download | vcxsrv-d435b20322433b335a4fc5693cce0399a3f27b2d.tar.gz vcxsrv-d435b20322433b335a4fc5693cce0399a3f27b2d.tar.bz2 vcxsrv-d435b20322433b335a4fc5693cce0399a3f27b2d.zip |
Updated to libXfont 1.4.8
Diffstat (limited to 'libXfont/src/fontfile/fontdir.c')
-rw-r--r-- | libXfont/src/fontfile/fontdir.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libXfont/src/fontfile/fontdir.c b/libXfont/src/fontfile/fontdir.c index ef7ffa561..7271603ec 100644 --- a/libXfont/src/fontfile/fontdir.c +++ b/libXfont/src/fontfile/fontdir.c @@ -177,6 +177,11 @@ FontFileAddEntry(FontTablePtr table, FontEntryPtr prototype) if (table->sorted) return (FontEntryPtr) 0; /* "cannot" happen */ if (table->used == table->size) { + if (table->size >= ((INT32_MAX / sizeof(FontEntryRec)) - 100)) + /* If we've read so many entries we're going to ask for 2gb + or more of memory, something is so wrong with this font + directory that we should just give up before we overflow. */ + return NULL; newsize = table->size + 100; entry = realloc(table->entries, newsize * sizeof(FontEntryRec)); if (!entry) |