From: Michael R Sweet Date: Sat, 13 Jun 2026 16:21:46 +0000 (-0400) Subject: Fix JSON and PPD/PS long number error handling (Issue #1608) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fcups.git Fix JSON and PPD/PS long number error handling (Issue #1608) --- diff --git a/cups/json.c b/cups/json.c index a71937f06a..3b87359c7d 100644 --- a/cups/json.c +++ b/cups/json.c @@ -1005,6 +1005,9 @@ cupsJSONImportString(const char *s) // I - JSON string goto error; current->value.number = _cupsStrScand(s, (char **)&s, loc); + if (!s) + goto error; + count ++; prev = current; diff --git a/cups/raster-interpret.c b/cups/raster-interpret.c index 69d7858e86..60aa04aedd 100644 --- a/cups/raster-interpret.c +++ b/cups/raster-interpret.c @@ -1322,6 +1322,8 @@ scan_ps(_cups_ps_stack_t *st, /* I - Stack */ */ obj.value.number = _cupsStrScand(start, &cur, localeconv()); + if (!cur) + return (NULL); break; } else