From: Zdenek Dohnal Date: Fri, 24 Nov 2023 10:46:53 +0000 (+0100) Subject: raster-interpreter.c: Fix crash in 'scan_ps()' found by fuzzer X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F834%2Fhead;p=thirdparty%2Fcups.git 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 --- 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... */