diff options
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c index da753a0..72fa68f 100644 --- a/super-intel.c +++ b/super-intel.c @@ -961,6 +961,12 @@ static int imsm_enumerate_ports(const char *hba_path, int port_count, int host_b /* 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; |