telemetry: fix buffer overrun if max bytes read
authorCiara Power <ciara.power@intel.com>
Tue, 12 May 2020 15:29:02 +0000 (16:29 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 19 May 2020 13:05:56 +0000 (15:05 +0200)
commita0c21662b4ee323966693093b0f704fa797e3f17
tree46193b44ea645fc08a80e5c8ab46dbf2628280c7
parent07580a734b99df9984da47a5ea844ba65d69f929
telemetry: fix buffer overrun if max bytes read

If 1024 bytes were received over the socket, this caused
buffer_recvf[bytes] to overrun the array. The size of the buffer - 1 is
now passed to the read function.

Coverity issue: 358442
Fixes: b80fe1805eee ("telemetry: introduce backward compatibility")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
lib/librte_telemetry/telemetry_legacy.c