Check returned value after strtok()
CID 355674 (#1 of 1): Dereference null return value (NULL_RETURNS)
4. dereference: Dereferencing a pointer that might be NULL s when
calling inet_pton
Fixes:
103809d032cd ("app/test-fib: add test application for FIB")
Cc: stable@dpdk.org
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
while (fgets(line, sizeof(line), f) != NULL) {
s = strtok(line, " \t\n");
+ if (s == NULL)
+ return -EINVAL;
ret = inet_pton(af, s, &tbl[i]);
if (ret != 1)
return -EINVAL;