Skip to content

Commit

Permalink
Backport fix for crash in ppdEmitString()
Browse files Browse the repository at this point in the history
  • Loading branch information
zdohnal committed Jan 12, 2024
1 parent 4466263 commit 5de694b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Changes in CUPS v2.4.8 (TBA)
- Fixed setting job state reasons for successful jobs (Issue #832)
- Added additional check on socket if `revents` from `poll()` returns POLLHUP
together with POLLIN or POLLOUT in `httpAddrConnect2()` (Issue #839)
- Fixed crash in `ppdEmitString()` if `size` is NULL (Issue #850)
- Fixed IPP backend to support the "print-scaling" option with IPP printers
(Issue #862)

Expand Down
7 changes: 6 additions & 1 deletion cups/ppd-emit.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,12 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
strlcpy(bufptr, "%%BeginFeature: *CustomPageSize True\n", (size_t)(bufend - bufptr + 1));
bufptr += 37;

size = ppdPageSize(ppd, "Custom");
if ((size = ppdPageSize(ppd, "Custom")) == NULL)
{
free(buffer);
free(choices);
return (NULL);
}

memset(values, 0, sizeof(values));

Expand Down

0 comments on commit 5de694b

Please sign in to comment.