From 609ea2bdeb4bdfccc9c0ec0ef5ba6de8d3e0b709 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Fri, 24 Nov 2023 11:46:53 +0100 Subject: [PATCH] raster-interpreter.c: Fix crash in 'scan_ps()' found by fuzzer Fuzzer using `_cupsRasterExecPS()` found a way how to pass NULL into `scan_ps()`, causing crash - we have to sanitize the argument for NULL to fix it. Fixes #831 --- cups/raster-interpret.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cups/raster-interpret.c b/cups/raster-interpret.c index 4387876bf7..45f2b22427 100644 --- a/cups/raster-interpret.c +++ b/cups/raster-interpret.c @@ -1047,6 +1047,8 @@ scan_ps(_cups_ps_stack_t *st, /* I - Stack */ int parens; /* Parenthesis nesting level */ + if (!*ptr) + return (NULL); /* * Skip leading whitespace... */ -- 2.47.2