mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
qcacld-3.0: Fix buffer over flow in hdd state ctrl
In hdd state ctrl API buf used beyond its size. Increase buf size to 3 to get rid of buffer over flow. CRs-fixed: 2029584 Change-Id: Ie353d449f167bee05833841350d61dc0935786fc
This commit is contained in:
parent
e31c5f5d94
commit
c356f15969
1 changed files with 4 additions and 4 deletions
|
|
@ -10547,23 +10547,23 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp,
|
|||
size_t count,
|
||||
loff_t *f_pos)
|
||||
{
|
||||
char buf;
|
||||
char buf[3];
|
||||
static const char wlan_off_str[] = "OFF";
|
||||
static const char wlan_on_str[] = "ON";
|
||||
int ret;
|
||||
unsigned long rc;
|
||||
|
||||
if (copy_from_user(&buf, user_buf, 3)) {
|
||||
if (copy_from_user(buf, user_buf, 3)) {
|
||||
pr_err("Failed to read buffer\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (strncmp(&buf, wlan_off_str, strlen(wlan_off_str)) == 0) {
|
||||
if (strncmp(buf, wlan_off_str, strlen(wlan_off_str)) == 0) {
|
||||
pr_debug("Wifi turning off from UI\n");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (strncmp(&buf, wlan_on_str, strlen(wlan_on_str)) != 0) {
|
||||
if (strncmp(buf, wlan_on_str, strlen(wlan_on_str)) != 0) {
|
||||
pr_err("Invalid value received from framework");
|
||||
goto exit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue