summaryrefslogtreecommitdiff
path: root/src/WrFFrI.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2004-09-15 15:47:39 +0000
committerDaniel Stone <daniel@fooishbar.org>2004-09-15 15:47:39 +0000
commit19066719975d0dbfa51c6b413a3760ed7cf93ddc (patch)
treec757de7bbe7881acf219c1f4bf0b3459fbd8cd84 /src/WrFFrI.c
parent2773a7214e282f6f673483f5233b880505947c3f (diff)
Merge patch from Mathieu Herrb to fix several integer overflows and otherXORG-6_8_1
security errors in libXpm.
Diffstat (limited to 'src/WrFFrI.c')
-rw-r--r--src/WrFFrI.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/WrFFrI.c b/src/WrFFrI.c
index 41b4c0d..5ef5814 100644
--- a/src/WrFFrI.c
+++ b/src/WrFFrI.c
@@ -248,6 +248,8 @@ WritePixels(file, width, height, cpp, pixels, colors)
unsigned int x, y, h;
h = height - 1;
+ if (cpp != 0 && width >= (SIZE_MAX - 3)/cpp)
+ return XpmNoMemory;
p = buf = (char *) XpmMalloc(width * cpp + 3);
if (!buf)
return (XpmNoMemory);