Re: [dpdk-dev] [PATCH] kvargs: fix crash when parsing an invalid token on FreeBSD

2020-04-30 Thread Huang, ZhiminX
Tested-by: Huang, ZhiminX Regards, HuangZhiMin -Original Message- From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Olivier Matz Sent: Wednesday, April 29, 2020 9:17 PM To: dev@dpdk.org Cc: sta...@dpdk.org Subject: [dpdk-dev] [PATCH] kvargs: fix crash when parsing an invalid token

[dpdk-dev] [PATCH] kvargs: fix crash when parsing an invalid token on FreeBSD

2020-04-29 Thread Olivier Matz
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