numam-dpdk/lib/librte_kvargs
Olivier Matz b2aa2c9723 kvargs: fix invalid token parsing on FreeBSD
The behavior of strtok_r() is not the same between GNU libc and FreeBSD
libc: in the first case, the context is set to "" when the last token is
returned, while in the second case it is set to NULL.

On FreeBSD, the current code crashes because we are dereferencing a NULL
pointer (ctx1). Fix it by first checking if it is NULL. This works with
both GNU and FreeBSD libc.

Fixes: ffcf831454 ("kvargs: fix buffer overflow when parsing list")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
2020-05-06 15:22:19 +02:00
..
Makefile eal: move common header files 2020-03-31 13:08:55 +02:00
meson.build build: remove individual library versions 2019-11-20 23:05:39 +01:00
rte_kvargs_version.map build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
rte_kvargs.c kvargs: fix invalid token parsing on FreeBSD 2020-05-06 15:22:19 +02:00
rte_kvargs.h kvargs: fix processing a null list 2018-10-24 15:06:46 +02:00