all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob c19fdb1d4384d7ccb3b7643db3a175de9f920165 1101 bytes (raw)
name: packages/patches/ghostscript-CVE-2015-3228.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 
The file names in the upstream patch below were modified to apply to GNU
ghostscript.

From 0c0b0859ae1aba64861599f0e7f74f143f305932 Mon Sep 17 00:00:00 2001
From: Chris Liddell <chris.liddell@artifex.com>
Date: Tue, 7 Jul 2015 16:57:41 +0100
Subject: [PATCH] Bug 696041: sanity check for memory allocation.

In gs_heap_alloc_bytes(), add a sanity check to ensure we don't overflow the
variable holding the actual number of bytes we allocate.

No cluster differences
---
 gs/base/gsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/base/gsmalloc.c b/base/gsmalloc.c
index 624552d..cad79c2 100644
--- a/base/gsmalloc.c
+++ b/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");
-- 
2.4.6


debug log:

solving c19fdb1d4384d7ccb3b7643db3a175de9f920165 ...
found c19fdb1d4384d7ccb3b7643db3a175de9f920165 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.