summaryrefslogtreecommitdiff
path: root/x11/XFree86-libs/patches/patch-av
blob: a9b30465a421522983aed827c9a1fff85c1790e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$NetBSD: patch-av,v 1.1.1.1 2004/01/24 08:47:32 xtraeme Exp $

--- lib/font/fc/fsconvert.c.orig	2002-09-10 16:14:35.000000000 +0000
+++ lib/font/fc/fsconvert.c	2003-09-24 08:32:26.000000000 +0000
@@ -36,6 +36,7 @@
 #include	"fontstruct.h"
 #include	"fservestr.h"
 #include	"fontutil.h"
+#include	"fslibos.h"
 
 extern char _fs_glyph_undefined;
 extern char _fs_glyph_requested;
@@ -102,6 +103,10 @@
 
     nprops = pfi->nprops = pi->num_offsets;
 
+    if (nprops < 0 
+	|| nprops > SIZE_T_MAX/(sizeof(FontPropRec) + sizeof(char))) 
+	return -1;
+	   
     dprop = (FontPropPtr) xalloc(sizeof(FontPropRec) * nprops +
 				 sizeof (char) * nprops);
     if (!dprop)