mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-05 14:17:43 +00:00
mtd: terminate user-provided string
Noticed by Coverity as a potential security issue. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
537ab1bd47
commit
1cc8d84133
1 changed files with 3 additions and 0 deletions
|
@ -549,6 +549,9 @@ static int mtdchar_blkpg_ioctl(struct mtd_info *mtd,
|
|||
if (mtd_is_partition(mtd))
|
||||
return -EINVAL;
|
||||
|
||||
/* Sanitize user input */
|
||||
p.devname[BLKPG_DEVNAMELTH - 1] = '\0';
|
||||
|
||||
return mtd_add_partition(mtd, p.devname, p.start, p.length);
|
||||
|
||||
case BLKPG_DEL_PARTITION:
|
||||
|
|
Loading…
Add table
Reference in a new issue