From: Florian Forster Date: Fri, 18 Dec 2015 08:24:19 +0000 (+0100) Subject: network plugin: Check range of pkg_numval. X-Git-Tag: collectd-5.6.0~483 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2f0eb44da35bee5a0fb62c182ff67fd155aeac25;p=collectd.git network plugin: Check range of pkg_numval. This is essentially the same as the check using exp_size a couple lines earlier, but that appears to be too indirect for Coverity to understand. This hopefully fixes the resulting "tainted_data_return" errors. CID: 48420 --- diff --git a/src/network.c b/src/network.c index 91690006..f44fe621 100644 --- a/src/network.c +++ b/src/network.c @@ -817,6 +817,7 @@ static int parse_part_values (void **ret_buffer, size_t *ret_buffer_len, exp_size, buffer_len); return (-1); } + assert (pkg_numval <= ((buffer_len - 6) / 9)); if (pkg_length != exp_size) {