[meego-commits] 5557: Changes to Trunk:Testing/ghostscript

Lisa Yue ling.yue at intel.com
Mon Jul 12 06:40:43 UTC 2010


Hi,
I have made the following changes to ghostscript in project Trunk:Testing. Please review and accept ASAP.

Thank You,
Lisa Yue

[This message was auto-generated]

---

Request #5557:

  submit:   home:lisayue:branches:Trunk:Testing/ghostscript(r2)(cleanup) -> Trunk:Testing/ghostscript


Message:
    Add ghostscript-CVE-2010-1628.patch to fix BMC#2414

State:   new          2010-07-11T18:35:48 lisayue
Comment: None



changes files:
--------------
--- ghostscript.changes
+++ ghostscript.changes
@@ -0,0 +1,3 @@
+* Fri Jul 09 2010 Ling Yue <ling.yue at intel.com> - 8.71
+- Add ghostscript-CVE-2010-1628.patch to fix BMC#2414
+

new:
----
  ghostscript-CVE-2010-1628.patch

spec files:
-----------
--- ghostscript.spec
+++ ghostscript.spec
@@ -36,6 +36,7 @@
 Patch16:     ghostscript-tif-fail-close.patch
 Patch17:     ghostscript-tiff-default-strip-size.patch
 Patch18:     ghostscript-tiff-fixes.patch
+Patch19:     ghostscript-CVE-2010-1628.patch
 Requires:   urw-fonts >= 1.1
 Requires:   ghostscript-fonts
 Requires(post): /sbin/ldconfig
@@ -152,6 +153,8 @@
 %patch17 -p1
 # ghostscript-tiff-fixes.patch
 %patch18 -p1
+# ghostscript-CVE-2010-1628.patch
+%patch19 -p1
 # >> setup
 # Convert manual pages to UTF-8
 from8859_1() {

other changes:
--------------

++++++ ghostscript-CVE-2010-1628.patch (new)
--- ghostscript-CVE-2010-1628.patch
+++ ghostscript-CVE-2010-1628.patch
+diff --git a/psi/ialloc.c b/psi/ialloc.c
+index cd5eb02..2888d96 100644
+--- a/psi/ialloc.c
++++ b/psi/ialloc.c
+@@ -185,7 +185,14 @@ gs_alloc_ref_array(gs_ref_memory_t * mem, ref * parr, uint attrs,
+ 	 */
+ 	chunk_t *pcc = mem->pcc;
+ 	ref *end;
++	alloc_change_t *cp = 0;
++        int code = 0;
+ 
++	if ((gs_memory_t *)mem != mem->stable_memory) {
++	    code = alloc_save_change_alloc(mem, "gs_alloc_ref_array", &cp);
++	    if (code < 0)
++		return code;
++	}
+ 	obj = gs_alloc_struct_array((gs_memory_t *) mem, num_refs + 1,
+ 				    ref, &st_refs, cname);
+ 	if (obj == 0)
+@@ -210,14 +217,10 @@ gs_alloc_ref_array(gs_ref_memory_t * mem, ref * parr, uint attrs,
+ 	    chunk_locate_ptr(obj, &cl);
+ 	    cl.cp->has_refs = true;
+ 	}
+-	if ((gs_memory_t *)mem != mem->stable_memory) {
+-	    ref_packed **ppr = 0;
+-	    int code = alloc_save_change_alloc(mem, "gs_alloc_ref_array", &ppr);
+-	    if (code < 0)
+-		return code;
+-            if (ppr)
+-	        *ppr = (ref_packed *)obj;
+-	}
++	if (cp) {
++            mem->changes = cp;
++            cp->where = (ref_packed *)obj;
++        }
+     }
+     make_array(parr, attrs | mem->space, num_refs, obj);
+     return 0;
+diff --git a/psi/idosave.h b/psi/idosave.h
+index 8a6b294..f0cf692 100644
+--- a/psi/idosave.h
++++ b/psi/idosave.h
+@@ -18,6 +18,22 @@
+ #  define idosave_INCLUDED
+ 
+ /*
++ * Structure for saved change chain for save/restore.  Because of the
++ * garbage collector, we need to distinguish the cases where the change
++ * is in a static object, a dynamic ref, or a dynamic struct.
++ */
++typedef struct alloc_change_s alloc_change_t;
++struct alloc_change_s {
++    alloc_change_t *next;
++    ref_packed *where;
++    ref contents;
++#define AC_OFFSET_STATIC (-2)	/* static object */
++#define AC_OFFSET_REF (-1)	/* dynamic ref */
++#define AC_OFFSET_ALLOCATED (-3) /* a newly allocated ref array */
++    short offset;		/* if >= 0, offset within struct */
++};
++
++/*
+  * Save a change that must be undone by restore.  We have to pass the
+  * pointer to the containing object to alloc_save_change for two reasons:
+  *
+@@ -29,6 +45,7 @@
+  * relocate the pointer to it from the change record during garbage
+  * collection.
+  */
++
+ int alloc_save_change(gs_dual_memory_t *dmem, const ref *pcont,
+ 		      ref_packed *ptr, client_name_t cname);
+ int alloc_save_change_in(gs_ref_memory_t *mem, const ref *pcont,
+@@ -36,6 +53,6 @@ int alloc_save_change_in(gs_ref_memory_t *mem, const ref *pcont,
+ /* Remove an AC_OFFSET_ALLOCATED element. */
+ void alloc_save_remove(gs_ref_memory_t *mem, ref_packed *obj, client_name_t cname);
+ /* Allocate a structure for recording an allocation event. */
+-int alloc_save_change_alloc(gs_ref_memory_t *mem, client_name_t cname, ref_packed ***ppr);
++int alloc_save_change_alloc(gs_ref_memory_t *mem, client_name_t cname, alloc_change_t **pcp);
+ 
+ #endif /* idosave_INCLUDED */
+diff --git a/psi/isave.c b/psi/isave.c
+index 0709c27..0d59911 100644
+--- a/psi/isave.c
++++ b/psi/isave.c
+@@ -156,22 +156,6 @@ print_save(const char *str, uint spacen, const alloc_save_t *sav)
+ /* A link to igcref.c . */
+ ptr_proc_reloc(igc_reloc_ref_ptr_nocheck, ref_packed);
+ 
+-/*
+- * Structure for saved change chain for save/restore.  Because of the
+- * garbage collector, we need to distinguish the cases where the change
+- * is in a static object, a dynamic ref, or a dynamic struct.
+- */
+-typedef struct alloc_change_s alloc_change_t;
+-struct alloc_change_s {
+-    alloc_change_t *next;
+-    ref_packed *where;
+-    ref contents;
+-#define AC_OFFSET_STATIC (-2)	/* static object */
+-#define AC_OFFSET_REF (-1)	/* dynamic ref */
+-#define AC_OFFSET_ALLOCATED (-3) /* a newly allocated ref array */
+-    short offset;		/* if >= 0, offset within struct */
+-};
+-
+ static 
+ CLEAR_MARKS_PROC(change_clear_marks)
+ {
+@@ -519,7 +503,7 @@ alloc_save_change(gs_dual_memory_t * dmem, const ref * pcont,
+ 
+ /* Allocate a structure for recording an allocation event. */
+ int
+-alloc_save_change_alloc(gs_ref_memory_t *mem, client_name_t cname, ref_packed ***ppr)
++alloc_save_change_alloc(gs_ref_memory_t *mem, client_name_t cname, alloc_change_t **pcp)
+ {
+     register alloc_change_t *cp;
+ 
+@@ -533,8 +517,7 @@ alloc_save_change_alloc(gs_ref_memory_t *mem, client_name_t cname, ref_packed **
+     cp->where = 0;
+     cp->offset = AC_OFFSET_ALLOCATED;
+     make_null(&cp->contents);
+-    mem->changes = cp;
+-    *ppr = &cp->where;
++    *pcp = cp;
+     return 1;
+ }
+ 

++++++ ghostscript.yaml
--- ghostscript.yaml
+++ ghostscript.yaml
@@ -30,6 +30,7 @@
     - ghostscript-tif-fail-close.patch
     - ghostscript-tiff-default-strip-size.patch
     - ghostscript-tiff-fixes.patch
+    - ghostscript-CVE-2010-1628.patch
 Description: |
     Ghostscript is a set of software that provides a PostScript
     interpreter, a set of C procedures (the Ghostscript library, which



More information about the MeeGo-commits mailing list