$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)
