cb339b0e86
Fixed CVE-2015-3228 (bsc#939342) OBS-URL: https://build.opensuse.org/request/show/319418 OBS-URL: https://build.opensuse.org/package/show/Printing/ghostscript?expand=0&rev=53
12 lines
463 B
Diff
12 lines
463 B
Diff
--- base/gsmalloc.c
|
|
+++ base/gsmalloc.c
|
|
@@ -178,7 +178,7 @@ gs_heap_alloc_bytes(gs_memory_t * mem, uint size, client_name_t cname)
|
|
} 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 *) Memento_label(malloc(added), cname)) == 0)
|
|
set_msg("failed");
|