Skip to content

Commit 4310a07

Browse files
Merge pull request #692 from AtariDreams/inverse-check
Check that the number of trays is consistent before fetching anymore data
2 parents fa046ca + ac27694 commit 4310a07

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

tools/ippeveprinter.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7864,18 +7864,23 @@ show_media(ippeve_client_t *client) /* I - Client connection */
78647864
return (1);
78657865
}
78667866

7867-
num_ready = ippGetCount(media_col_ready);
7868-
num_sizes = ippGetCount(media_sizes);
78697867
num_sources = ippGetCount(media_sources);
7870-
num_types = ippGetCount(media_types);
78717868

7869+
/*
7870+
* Make sure the number of trays is consistent.
7871+
*/
7872+
78727873
if (num_sources != ippGetCount(input_tray))
78737874
{
78747875
html_printf(client, "<p>Error: Different number of trays in media-source-supported and printer-input-tray defined for printer.</p>\n");
78757876
html_footer(client);
78767877
return (1);
78777878
}
78787879

7880+
num_ready = ippGetCount(media_col_ready);
7881+
num_sizes = ippGetCount(media_sizes);
7882+
num_types = ippGetCount(media_types);
7883+
78797884
/*
78807885
* Process form data if present...
78817886
*/

0 commit comments

Comments
 (0)