drm/msm/hdmi-staging: Fix Buffer Overflow
This change is done to check the size of input before doing the buffer copy. Change-Id: I01f8b1f3c3b6e920f186f5f90ea9707bb25bcbbc Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
This commit is contained in:
parent
fc509761a1
commit
13d43fca0c
1 changed files with 6 additions and 1 deletions
|
@ -78,7 +78,12 @@ static ssize_t _sde_hdmi_debugfs_dump_info_read(struct file *file,
|
|||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
len += snprintf(buf, SZ_4K, "name = %s\n", display->name);
|
||||
len += snprintf(buf, SZ_1K, "name = %s\n", display->name);
|
||||
|
||||
if (len > count) {
|
||||
kfree(buf);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (copy_to_user(buff, buf, len)) {
|
||||
kfree(buf);
|
||||
|
|
Loading…
Add table
Reference in a new issue