Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 172575 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/bitmap/bdfread.c (+11 lines)
Lines 65-70 from The Open Group. Link Here
65
#include <X11/fonts/bitmap.h>
65
#include <X11/fonts/bitmap.h>
66
#include <X11/fonts/bdfint.h>
66
#include <X11/fonts/bdfint.h>
67
67
68
#if HAVE_STDINT_H
69
#include <stdint.h>
70
#elif !defined(INT32_MAX)
71
#define INT32_MAX 0x7fffffff
72
#endif
73
68
#define INDICES 256
74
#define INDICES 256
69
#define MAXENCODING 0xFFFF
75
#define MAXENCODING 0xFFFF
70
#define BDFLINELEN  1024
76
#define BDFLINELEN  1024
Lines 288-293 bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState, Link Here
288
	bdfError("invalid number of CHARS in BDF file\n");
294
	bdfError("invalid number of CHARS in BDF file\n");
289
	return (FALSE);
295
	return (FALSE);
290
    }
296
    }
297
    if (nchars > INT32_MAX / sizeof(CharInfoRec)) {
298
	bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
299
		 sizeof(CharInfoRec));
300
	goto BAILOUT;
301
    }
291
    ci = (CharInfoPtr) xalloc(nchars * sizeof(CharInfoRec));
302
    ci = (CharInfoPtr) xalloc(nchars * sizeof(CharInfoRec));
292
    if (!ci) {
303
    if (!ci) {
293
	bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
304
	bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
(-)a/src/fontfile/fontdir.c (+8 lines)
Lines 38-46 in this Software without prior written authorization from The Open Group. Link Here
38
#include    <X11/fonts/fntfilst.h>
38
#include    <X11/fonts/fntfilst.h>
39
#include    <X11/keysym.h>
39
#include    <X11/keysym.h>
40
40
41
#if HAVE_STDINT_H
42
#include <stdint.h>
43
#elif !defined(INT32_MAX)
44
#define INT32_MAX 0x7fffffff
45
#endif
46
41
Bool
47
Bool
42
FontFileInitTable (FontTablePtr table, int size)
48
FontFileInitTable (FontTablePtr table, int size)
43
{
49
{
50
    if (size < 0 || (size > INT32_MAX/sizeof(FontEntryRec))) 
51
	return FALSE;
44
    if (size)
52
    if (size)
45
    {
53
    {
46
	table->entries = (FontEntryPtr) xalloc(sizeof(FontEntryRec) * size);
54
	table->entries = (FontEntryPtr) xalloc(sizeof(FontEntryRec) * size);

Return to bug 172575