mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
drivers: video: Add bounds checking in fb_cmap_to_user
Verify that unsigned int value will not become negative before cast to signed int. Bug: 31651010 Change-Id: I548a200f678762042617f11100b6966a405a3920
This commit is contained in:
parent
1180db142c
commit
d39b8b9e21
1 changed files with 1 additions and 1 deletions
|
@ -196,7 +196,7 @@ int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to)
|
|||
int tooff = 0, fromoff = 0;
|
||||
int size;
|
||||
|
||||
if (!to || !from)
|
||||
if (!to || !from || (int)(to->start) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
if (to->start > from->start)
|
||||
|
|
Loading…
Reference in a new issue