Skip to content

Commit 4d0deb3

Browse files
ZhaoLong Wangrichardweinberger
authored andcommitted
ubi: Reserve sufficient buffer length for the input mask
Because the mask received by the emulate_failures interface is a 32-bit unsigned integer, ensure that there is sufficient buffer length to receive and display this value. Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com> Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 7cd8d1f commit 4d0deb3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/mtd/ubi/debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static ssize_t dfs_file_read(struct file *file, char __user *user_buf,
332332
struct dentry *dent = file->f_path.dentry;
333333
struct ubi_device *ubi;
334334
struct ubi_debug_info *d;
335-
char buf[8];
335+
char buf[16];
336336
int val;
337337

338338
ubi = ubi_get_device(ubi_num);
@@ -400,7 +400,7 @@ static ssize_t dfs_file_write(struct file *file, const char __user *user_buf,
400400
struct ubi_device *ubi;
401401
struct ubi_debug_info *d;
402402
size_t buf_size;
403-
char buf[8] = {0};
403+
char buf[16] = {0};
404404
int val;
405405

406406
ubi = ubi_get_device(ubi_num);

0 commit comments

Comments
 (0)