1
Index: libxfont-1.2.7/src/bitmap/bdfread.c
2
===================================================================
3
--- libxfont-1.2.7.orig/src/bitmap/bdfread.c 2007-03-29 17:53:37.000000000 -0700
4
+++ libxfont-1.2.7/src/bitmap/bdfread.c 2007-03-29 17:53:54.000000000 -0700
6
#include <X11/fonts/bitmap.h>
7
#include <X11/fonts/bdfint.h>
11
+#elif !defined(INT32_MAX)
12
+#define INT32_MAX 0x7fffffff
16
#define MAXENCODING 0xFFFF
17
#define BDFLINELEN 1024
19
bdfError("invalid number of CHARS in BDF file\n");
22
+ if (nchars > INT32_MAX / sizeof(CharInfoRec)) {
23
+ bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
24
+ sizeof(CharInfoRec));
27
ci = (CharInfoPtr) xalloc(nchars * sizeof(CharInfoRec));
29
bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
30
Index: libxfont-1.2.7/src/fontfile/fontdir.c
31
===================================================================
32
--- libxfont-1.2.7.orig/src/fontfile/fontdir.c 2007-03-29 17:53:37.000000000 -0700
33
+++ libxfont-1.2.7/src/fontfile/fontdir.c 2007-03-29 17:53:54.000000000 -0700
35
#include <X11/fonts/fntfilst.h>
36
#include <X11/keysym.h>
40
+#elif !defined(INT32_MAX)
41
+#define INT32_MAX 0x7fffffff
45
FontFileInitTable (FontTablePtr table, int size)
47
+ if (size < 0 || (size > INT32_MAX/sizeof(FontEntryRec)))
51
table->entries = (FontEntryPtr) xalloc(sizeof(FontEntryRec) * size);