From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Sat, 13 May 2023 19:14:34 +0000 (-0400) Subject: Check that the number of trays is consistent before fetching anymore data X-Git-Tag: v2.4.3~16^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac27694580b0b56f53e0f6d391637017d683d685;p=thirdparty%2Fcups.git Check that the number of trays is consistent before fetching anymore data There is no point in getting this data otherwise if the number of sources defined for the media_sources and for the input_tray differ. --- diff --git a/tools/ippeveprinter.c b/tools/ippeveprinter.c index c41deeecf8..041a468ef7 100644 --- a/tools/ippeveprinter.c +++ b/tools/ippeveprinter.c @@ -7864,11 +7864,12 @@ show_media(ippeve_client_t *client) /* I - Client connection */ return (1); } - num_ready = ippGetCount(media_col_ready); - num_sizes = ippGetCount(media_sizes); num_sources = ippGetCount(media_sources); - num_types = ippGetCount(media_types); + /* + * Make sure the number of trays is consistent. + */ + if (num_sources != ippGetCount(input_tray)) { html_printf(client, "

Error: Different number of trays in media-source-supported and printer-input-tray defined for printer.

\n"); @@ -7876,6 +7877,10 @@ show_media(ippeve_client_t *client) /* I - Client connection */ return (1); } + num_ready = ippGetCount(media_col_ready); + num_sizes = ippGetCount(media_sizes); + num_types = ippGetCount(media_types); + /* * Process form data if present... */