components/ghostscript/patches/23044678.patch
author srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
Wed, 03 Aug 2016 22:12:16 -0700
branchs11u3-sru
changeset 6545 5adda0d0f036
permissions -rw-r--r--
21516009 problem in UTILITY/GHOSTSCRIPT
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6545
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
     1
The patch has been taken from community and fixes Integer overflow.
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
     2
The details can be found in the following location
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
     3
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=0c0b0859
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
     4
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
     5
--- ghostscript-9.00/base/gsmalloc.c	Thu Apr 29 11:32:44 2010
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
     6
+++ ghostscript-9.00/base/gsmalloc.c	Tue Aug 11 03:28:23 2015
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
     7
@@ -177,7 +177,7 @@
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
     8
     } else {
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
     9
 	uint added = size + sizeof(gs_malloc_block_t);
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
    10
 
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
    11
-	if (mmem->limit - added < mmem->used)
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
    12
+	if (added <= size || mmem->limit - added < mmem->used)
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
    13
 	    set_msg("exceeded limit");
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
    14
 	else if ((ptr = (byte *) malloc(added)) == 0)
5adda0d0f036 21516009 problem in UTILITY/GHOSTSCRIPT
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff changeset
    15
 	    set_msg("failed");