mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 03:31:26 +00:00
iscsi-scst, isert: Add address length check in isert_listen_ioctl()
Detected by Coverity. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
@@ -395,6 +395,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