[gs-cvs] rev 6973 - trunk/gs/src

alexcher at ghostscript.com alexcher at ghostscript.com
Sun Aug 6 13:36:35 PDT 2006


Author: alexcher
Date: 2006-08-06 13:36:34 -0700 (Sun, 06 Aug 2006)
New Revision: 6973

Modified:
   trunk/gs/src/zdict.c
Log:
Makes dictstack check for the array size before checking for the access status.


Modified: trunk/gs/src/zdict.c
===================================================================
--- trunk/gs/src/zdict.c	2006-08-06 14:13:41 UTC (rev 6972)
+++ trunk/gs/src/zdict.c	2006-08-06 20:36:34 UTC (rev 6973)
@@ -329,9 +329,14 @@
     os_ptr op = osp;
     uint count = ref_stack_count(&d_stack);
 
-    check_write_type(*op, t_array);
     if (!level2_enabled)
 	count--;		/* see dstack.h */
+    if (!r_is_array(op))
+	return_op_typecheck(op);
+    if (r_size(op) < count)
+        return_error(e_rangecheck);
+    if (!r_has_type_attrs(op, t_array, a_write)) 
+        return_error(e_invalidaccess);
     return ref_stack_store(&d_stack, op, count, 0, 0, true, idmemory,
 			   "dictstack");
 }



More information about the gs-cvs mailing list