]> git.ipfire.org Git - thirdparty/cups.git/commit
backend/ipp.c: Fix printing jobs with long names on older IPP printers
authorzdohnal <zdohnal@redhat.com>
Tue, 16 Jan 2024 12:27:10 +0000 (13:27 +0100)
committerGitHub <noreply@github.com>
Tue, 16 Jan 2024 12:27:10 +0000 (13:27 +0100)
commit881eab1ec12b2af1e14a45186b9e2b1dc6077bba
tree4a79fcd4d5c064968f271cff8e97f7b254e9b1d9
parent89f7f5d3d129bc6b902ee92ce6a6af5163fc8564
parentd9598119e3e6a45eda9da08cc44a085039ab6552
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