libdpkg: Move compression level max bound check from dpkg-deb
commit75d0fbec710d21965cb0d2c05bd43b26ca47842b
authorGuillem Jover <guillem@debian.org>
Sun, 8 Jan 2023 02:39:24 +0000 (8 03:39 +0100)
committerGuillem Jover <guillem@debian.org>
Tue, 10 Jan 2023 04:35:33 +0000 (10 05:35 +0100)
treece5d196fe07c96be10f0a7a6cb00d8f265790453
parent86ceb336de72a69e347c175805b49cfbbc333f99
libdpkg: Move compression level max bound check from dpkg-deb

The compression level max bound check is specific to each compressor,
and we cannot simply use a single max bound for every compressor. Move
the check into the compressor_check_params() function where we can check
whether it is coherent with the compressor requested.

The dpkg_options_parse_arg_int() already makes sure we get a sanitized
value that is 0 or larger but not larger than INT_MAX.
lib/dpkg/compress.c
src/deb/main.c