bus/pci: fix allocation of device path
authorFerruh Yigit <ferruh.yigit@intel.com>
Fri, 23 Nov 2018 00:29:45 +0000 (00:29 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 25 Nov 2018 10:51:11 +0000 (11:51 +0100)
commitd3110b124af64199b0901223c7e0117f7480480f
treede5ed00a36f844921d1b84660e77cc3cec6a79ac
parent705dced4a72a1053368c84c4b68f04f028a78b30
bus/pci: fix allocation of device path

The pci_resource_by_index called strlen() on uninitialized
memory which would lead to the wrong size of memory allocated
for the path portion of the resource map. This would either cause
excessively large allocation, or worse memory corruption.

Coverity issue: 300868
Fixes: ea9d56226e72 ("pci: introduce function to map uio resource by index")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/bus/pci/linux/pci_uio.c