summaryrefslogtreecommitdiff
path: root/graphics/xpm/patches/patch-af
blob: 5a511d004247427862a82dc31f03ed12c2b24dd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
$NetBSD: patch-af,v 1.1 2004/09/16 15:09:01 minskim Exp $

--- lib/CrDatFrI.c.orig	Thu Mar 19 13:50:59 1998
+++ lib/CrDatFrI.c
@@ -123,6 +123,8 @@ XpmCreateDataFromXpmImage(data_return, i
      */
     header_nlines = 1 + image->ncolors;
     header_size = sizeof(char *) * header_nlines;
+    if (header_size >= SIZE_MAX / sizeof(char *))
+	return (XpmNoMemory);
     header = (char **) XpmCalloc(header_size, sizeof(char *));
     if (!header)
 	return (XpmNoMemory);