isert-scst: Add address length check in isert_listen_ioctl()

Detected by Coverity.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6365 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2015-06-17 00:19:27 +00:00
parent 26cda0eb38
commit 40a90a705d

View File

@@ -389,6 +389,13 @@ static long isert_listen_ioctl(struct file *filp, unsigned int cmd,
goto out;
}
if (unlikely(dev->info.addr_len > sizeof(dev->info.addr))) {
PRINT_ERROR("Invalid address length %zd > %zd",
dev->info.addr_len, sizeof(dev->info.addr));
res = -EINVAL;
goto out;
}
portal = isert_portal_add((struct sockaddr *)&dev->info.addr,
dev->info.addr_len);
if (IS_ERR(portal)) {