cfgfile: fix null pointer dereference in parsing
authorJacek Piasecki <jacekx.piasecki@intel.com>
Thu, 26 Oct 2017 06:24:06 +0000 (08:24 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 7 Nov 2017 01:18:38 +0000 (02:18 +0100)
commit74e0d3a17461fadda1987baab775f7068e3732b1
treeb86ecc89d6eb10cb4fc967142321d1e0615a2e3d
parentdc3c853ce230699ef8a5c08736e094f61d00158c
cfgfile: fix null pointer dereference in parsing

Function memchr() could return NULL and assign it to split[1] pointer.
Additional check and error handing is made after memchr() call.

Coverity issue: 195004
Fixes: a6a47ac9c2c9 ("cfgfile: rework load function")

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
lib/librte_cfgfile/rte_cfgfile.c