mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 14:44:12 +00:00
Staging: most: fix snprintf() is printing too much
This patch prevents snprintf from exceeding a given buffer size. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
add04a9854
commit
7ac5c9f0a0
1 changed files with 1 additions and 1 deletions
|
@ -983,7 +983,7 @@ static ssize_t store_add_link(struct most_aim_obj *aim_obj,
|
|||
return ret;
|
||||
|
||||
if (mdev_devnod == 0 || *mdev_devnod == 0) {
|
||||
snprintf(devnod_buf, PAGE_SIZE, "%s-%s", mdev, mdev_ch);
|
||||
snprintf(devnod_buf, sizeof(devnod_buf), "%s-%s", mdev, mdev_ch);
|
||||
mdev_devnod = devnod_buf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue