diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2007-03-25 13:03:23 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2007-03-25 13:03:23 +0000 |
commit | 42710414e901768bd661bb644f844e4704f4afce (patch) | |
tree | d259ac2e4b97655e1b13e0c050d16a1177aa725e /lib/libXfont/src/bitmap | |
parent | 9ad0f1c7cda3612f14c54c2dcca05b9a42fa35a2 (diff) |
regen with libtool 1.5.22p9
Diffstat (limited to 'lib/libXfont/src/bitmap')
-rw-r--r-- | lib/libXfont/src/bitmap/bdfread.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libXfont/src/bitmap/bdfread.c b/lib/libXfont/src/bitmap/bdfread.c index acb77e949..a6f0c1e7e 100644 --- a/lib/libXfont/src/bitmap/bdfread.c +++ b/lib/libXfont/src/bitmap/bdfread.c @@ -65,6 +65,12 @@ from The Open Group. #include <X11/fonts/bitmap.h> #include <X11/fonts/bdfint.h> +#if HAVE_STDINT_H +#include <stdint.h> +#elif !defined(INT32_MAX) +#define INT32_MAX 0x7fffffff +#endif + #define INDICES 256 #define MAXENCODING 0xFFFF #define BDFLINELEN 1024 @@ -288,6 +294,11 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState, bdfError("invalid number of CHARS in BDF file\n"); return (FALSE); } + if (nchars > INT32_MAX / sizeof(CharInfoRec)) { + bdfError("Couldn't allocate pCI (%d*%d)\n", nchars, + sizeof(CharInfoRec)); + goto BAILOUT; + } ci = (CharInfoPtr) xalloc(nchars * sizeof(CharInfoRec)); if (!ci) { bdfError("Couldn't allocate pCI (%d*%d)\n", nchars, |