Merge "diag: Prevent out-of-bound access while processing mask commands"
This commit is contained in:
commit
16819b1724
1 changed files with 4 additions and 0 deletions
|
@ -2270,6 +2270,8 @@ int diag_process_apps_masks(unsigned char *buf, int len, int pid)
|
|||
return -EINVAL;
|
||||
|
||||
if (*buf == DIAG_CMD_LOG_CONFIG) {
|
||||
if (len < (2 * sizeof(int)))
|
||||
return -EINVAL;
|
||||
sub_cmd = *(int *)(buf + sizeof(int));
|
||||
switch (sub_cmd) {
|
||||
case DIAG_CMD_OP_LOG_DISABLE:
|
||||
|
@ -2286,6 +2288,8 @@ int diag_process_apps_masks(unsigned char *buf, int len, int pid)
|
|||
break;
|
||||
}
|
||||
} else if (*buf == DIAG_CMD_MSG_CONFIG) {
|
||||
if (len < (2 * sizeof(uint8_t)))
|
||||
return -EINVAL;
|
||||
sub_cmd = *(uint8_t *)(buf + sizeof(uint8_t));
|
||||
switch (sub_cmd) {
|
||||
case DIAG_CMD_OP_GET_SSID_RANGE:
|
||||
|
|
Loading…
Add table
Reference in a new issue