eal: fix hotplug device parsing
authorGaetan Rivet <gaetan.rivet@6wind.com>
Fri, 4 Aug 2017 15:30:23 +0000 (17:30 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 4 Aug 2017 16:07:26 +0000 (18:07 +0200)
commit92ac1d5a13859e5dc65c94aaa94559680f2e26c9
tree367ceb1a6a10d6c5927c3798417a8e964efff2b2
parent7d4583558a58a8762c075f8b6af2787421a240cb
eal: fix hotplug device parsing

snprintf returns the length it would have written had the given length
been enough, *terminating null byte excluded*.

It will however limit the length of its writing to given length minus
one, and always put a terminating null-byte at the end of the string.

This must be taken into account when calculating the total length of the
device declaration string.

Fixes: 3054036f054a ("eal: fix possible crash in hotplug")

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
lib/librte_eal/common/eal_common_dev.c