mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 04:01:26 +00:00
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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user