Pointer 'c' returned from call to function 'strchr' at line 954 may
be NULL and will be dereferenced at line 955.
Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
/* chop device path to 'host%d' and calculate the port number */
c = strchr(&path[hba_len], '/');
+ if (!c) {
+ if (verbose)
+ fprintf(stderr, Name ": %s - invalid path name\n", path + hba_len);
+ err = 2;
+ break;
+ }
*c = '\0';
if (sscanf(&path[hba_len], "host%d", &port) == 1)
port -= host_base;