File CVE-2023-52722.patch of Package ghostscript-mini
--- psi/zmisc1.c.orig 2020-03-19 09:21:42.000000000 +0100
+++ psi/zmisc1.c 2024-05-06 14:02:47.380886762 +0200
@@ -93,6 +93,9 @@ zexE(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
+ if (gs_is_path_control_active(imemory) != 0 && state.cstate != 55665) {
+ return_error(gs_error_rangecheck);
+ }
return filter_write(i_ctx_p, code, &s_exE_template, (stream_state *)&state, 0);
}
@@ -130,6 +133,11 @@ zexD(i_ctx_t *i_ctx_p)
}
if (code < 0)
return code;
+
+ if (gs_is_path_control_active(imemory) != 0 && state.cstate != 55665) {
+ return_error(gs_error_rangecheck);
+ }
+
/*
* If we're reading a .PFB file, let the filter know about it,
* so it can read recklessly to the end of the binary section.