]> git.ipfire.org Git - thirdparty/cups.git/commit
backend/ipp.c: Fix printing jobs with long names on older IPP printers
authorZdenek Dohnal <zdohnal@redhat.com>
Tue, 16 Jan 2024 12:30:17 +0000 (13:30 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Tue, 16 Jan 2024 12:30:17 +0000 (13:30 +0100)
commitdc6d173de93eac51b5358fc438c5eec7dca6aa0a
treee6566fae23a33f52e845c39c980989d36e493549
parent9ef75d20ecb235272a3110d58e47fcf5bff8aac3
backend/ipp.c: Fix printing jobs with long names on older IPP printers

On older printers (ones which don't support IPP operation Create-Job)
we concatenate job number and title into one string, which we use as
IPP attribute job-name. If the original title was almost 255 chars,
the joining the strings will overflow maximal required length
for this attribute, and Validate-Job fails.

We could check whether the string is longer than 255 and cut it,
but I chose to shrink the buffer to 256, since we already use snprintf()
which will cut the string and put null terminator for us.

Fixes #644
CHANGES.md
backend/ipp.c