aboutsummaryrefslogtreecommitdiff
path: root/print/ghostscript8-x11/files/patch-base-gsmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'print/ghostscript8-x11/files/patch-base-gsmalloc.c')
-rw-r--r--print/ghostscript8-x11/files/patch-base-gsmalloc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/print/ghostscript8-x11/files/patch-base-gsmalloc.c b/print/ghostscript8-x11/files/patch-base-gsmalloc.c
new file mode 100644
index 000000000000..c4982de93012
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-gsmalloc.c
@@ -0,0 +1,11 @@
+--- base/gsmalloc.c.orig 2015-07-24 09:52:39.718916000 +0900
++++ base/gsmalloc.c 2015-07-24 09:54:31.761202000 +0900
+@@ -174,7 +174,7 @@
+ } else {
+ uint added = size + sizeof(gs_malloc_block_t);
+
+- if (mmem->limit - added < mmem->used)
++ if (added <= size || mmem->limit - added < mmem->used)
+ set_msg("exceeded limit");
+ else if ((ptr = (byte *) malloc(added)) == 0)
+ set_msg("failed");