Index: Attrib.c =================================================================== RCS file: /cvsroot/xsrc/xfree/xc/extras/Xpm/lib/Attrib.c,v retrieving revision 1.2 diff -u -r1.2 Attrib.c --- Attrib.c 16 Sep 2004 14:28:32 -0000 1.2 +++ Attrib.c 19 Sep 2004 11:35:59 -0000 @@ -52,7 +52,7 @@ XpmColor **colorTable, **color; int a; - if (ncolors >= SIZE_MAX / sizeof(XpmColor *)) + if (ncolors >= UINT_MAX / sizeof(XpmColor *)) return XpmNoMemory; colorTable = (XpmColor **) XpmMalloc(ncolors * sizeof(XpmColor *)); Index: CrDatFrI.c =================================================================== RCS file: /cvsroot/xsrc/xfree/xc/extras/Xpm/lib/CrDatFrI.c,v retrieving revision 1.2 diff -u -r1.2 CrDatFrI.c --- CrDatFrI.c 16 Sep 2004 14:28:32 -0000 1.2 +++ CrDatFrI.c 19 Sep 2004 11:35:59 -0000 @@ -124,7 +124,7 @@ */ header_nlines = 1 + image->ncolors; header_size = sizeof(char *) * header_nlines; - if (header_size >= SIZE_MAX / sizeof(char *)) + if (header_size >= UINT_MAX / sizeof(char *)) return (XpmNoMemory); header = (char **) XpmCalloc(header_size, sizeof(char *)); if (!header) Index: create.c =================================================================== RCS file: /cvsroot/xsrc/xfree/xc/extras/Xpm/lib/create.c,v retrieving revision 1.4 diff -u -r1.4 create.c --- create.c 16 Sep 2004 14:28:32 -0000 1.4 +++ create.c 19 Sep 2004 11:35:59 -0000 @@ -817,7 +817,7 @@ ErrorStatus = XpmSuccess; - if (image->ncolors >= SIZE_MAX / sizeof(Pixel)) + if (image->ncolors >= UINT_MAX / sizeof(Pixel)) return (XpmNoMemory); /* malloc pixels index tables */ @@ -992,7 +992,7 @@ return (XpmNoMemory); #if !defined(FOR_MSW) && !defined(AMIGA) - if (height != 0 && (*image_return)->bytes_per_line >= SIZE_MAX / height) + if (height != 0 && (*image_return)->bytes_per_line >= UINT_MAX / height) return XpmNoMemory; /* now that bytes_per_line must have been set properly alloc data */ (*image_return)->data = @@ -2061,7 +2061,7 @@ xpmGetCmt(data, &colors_cmt); /* malloc pixels index tables */ - if (ncolors >= SIZE_MAX / sizeof(Pixel)) + if (ncolors >= UINT_MAX / sizeof(Pixel)) return XpmNoMemory; image_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * ncolors); Index: hashtab.c =================================================================== RCS file: /cvsroot/xsrc/xfree/xc/extras/Xpm/lib/hashtab.c,v retrieving revision 1.2 diff -u -r1.2 hashtab.c --- hashtab.c 16 Sep 2004 14:28:32 -0000 1.2 +++ hashtab.c 19 Sep 2004 11:35:59 -0000 @@ -144,7 +144,7 @@ HASH_TABLE_GROWS table->size = size; table->limit = size / 3; - if (size >= SIZE_MAX / sizeof(*atomTable)) + if (size >= UINT_MAX / sizeof(*atomTable)) return (XpmNoMemory); atomTable = (xpmHashAtom *) XpmMalloc(size * sizeof(*atomTable)); if (!atomTable) @@ -206,7 +206,7 @@ table->size = INITIAL_HASH_SIZE; table->limit = table->size / 3; table->used = 0; - if (table->size >= SIZE_MAX / sizeof(*atomTable)) + if (table->size >= UINT_MAX / sizeof(*atomTable)) return (XpmNoMemory); atomTable = (xpmHashAtom *) XpmMalloc(table->size * sizeof(*atomTable)); if (!atomTable) Index: parse.c =================================================================== RCS file: /cvsroot/xsrc/xfree/xc/extras/Xpm/lib/parse.c,v retrieving revision 1.2 diff -u -r1.2 parse.c --- parse.c 16 Sep 2004 14:28:32 -0000 1.2 +++ parse.c 19 Sep 2004 11:35:59 -0000 @@ -205,7 +205,7 @@ char **defaults; int ErrorStatus; - if (ncolors >= SIZE_MAX / sizeof(XpmColor)) + if (ncolors >= UINT_MAX / sizeof(XpmColor)) return (XpmNoMemory); colorTable = (XpmColor *) XpmCalloc(ncolors, sizeof(XpmColor)); if (!colorTable) @@ -218,7 +218,7 @@ /* * read pixel value */ - if (cpp >= SIZE_MAX - 1) { + if (cpp >= UINT_MAX - 1) { xpmFreeColorTable(colorTable, ncolors); return (XpmNoMemory); } @@ -306,7 +306,7 @@ /* * read pixel value */ - if (cpp >= SIZE_MAX - 1) { + if (cpp >= UINT_MAX - 1) { xpmFreeColorTable(colorTable, ncolors); return (XpmNoMemory); } @@ -374,7 +374,7 @@ unsigned int a, x, y; if ((height > 0 && width >= SIZE_MAX / height) || - width * height >= SIZE_MAX / sizeof(unsigned int)) + width * height >= UINT_MAX / sizeof(unsigned int)) return XpmNoMemory; #ifndef FOR_MSW iptr2 = (unsigned int *) XpmMalloc(sizeof(unsigned int) * width * height); Index: scan.c =================================================================== RCS file: /cvsroot/xsrc/xfree/xc/extras/Xpm/lib/scan.c,v retrieving revision 1.2 diff -u -r1.2 scan.c --- scan.c 16 Sep 2004 14:28:32 -0000 1.2 +++ scan.c 19 Sep 2004 11:35:59 -0000 @@ -233,15 +233,15 @@ else cpp = 0; - if ((height > 0 && width >= SIZE_MAX / height) || - width * height >= SIZE_MAX / sizeof(unsigned int)) + if ((height > 0 && width >= UINT_MAX / height) || + width * height >= UINT_MAX / sizeof(unsigned int)) RETURN(XpmNoMemory); pmap.pixelindex = (unsigned int *) XpmCalloc(width * height, sizeof(unsigned int)); if (!pmap.pixelindex) RETURN(XpmNoMemory); - if (pmap.size >= SIZE_MAX / sizeof(Pixel)) + if (pmap.size >= UINT_MAX / sizeof(Pixel)) RETURN(XpmNoMemory); pmap.pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * pmap.size); @@ -308,7 +308,7 @@ * get rgb values and a string of char, and possibly a name for each * color */ - if (pmap.ncolors >= SIZE_MAX / sizeof(XpmColor)) + if (pmap.ncolors >= UINT_MAX / sizeof(XpmColor)) RETURN(XpmNoMemory); colorTable = (XpmColor *) XpmCalloc(pmap.ncolors, sizeof(XpmColor)); if (!colorTable) @@ -368,7 +368,7 @@ /* first get a character string */ a = 0; - if (cpp >= SIZE_MAX - 1) + if (cpp >= UINT_MAX - 1) return (XpmNoMemory); if (!(s = color->string = (char *) XpmMalloc(cpp + 1))) return (XpmNoMemory); @@ -461,7 +461,7 @@ } /* first get character strings and rgb values */ - if (ncolors >= SIZE_MAX / sizeof(XColor) || cpp >= SIZE_MAX - 1) + if (ncolors >= UINT_MAX / sizeof(XColor) || cpp >= UINT_MAX - 1) return (XpmNoMemory); xcolors = (XColor *) XpmMalloc(sizeof(XColor) * ncolors); if (!xcolors)