File CVE-2024-46956.patch of Package ghostscript.36165
--- psi/zfile.c.orig 2020-03-19 09:21:42.000000000 +0100
+++ psi/zfile.c 2024-10-25 13:46:55.710067901 +0200
@@ -439,7 +439,7 @@ file_continue(i_ctx_t *i_ctx_p)
if (code == ~(uint) 0) { /* all done */
esp -= 5; /* pop proc, pfen, devlen, iodev , mark */
return o_pop_estack;
- } else if (code > len) { /* overran string */
+ } else if (code > len - devlen) { /* overran string */
return_error(gs_error_rangecheck);
}
else if (iodev != iodev_default(imemory)