diag: Avoid possible out of bound access while sending masks
Due to mask size wrongly calculated with incorrect range possible out of bound access is possible. Prevent the possibility by correcting the range. Change-Id: I1b8c50411a6fb17f9ca6e90c0646690953f3db0e Signed-off-by: Manoj Prabhu B <quic_bmanoj@quicinc.com>
This commit is contained in:
parent
2959ed5eb8
commit
1e6a34af1e
@ -1156,7 +1156,7 @@ static int diag_cmd_set_msg_mask(unsigned char *src_buf, int src_len,
|
||||
mask_size = MAX_SSID_PER_RANGE;
|
||||
mask->range_tools = MAX_SSID_PER_RANGE;
|
||||
mask->ssid_last_tools =
|
||||
mask->ssid_first + mask->range_tools;
|
||||
mask->ssid_first + mask->range_tools - 1;
|
||||
}
|
||||
if (ssid_range.ssid_last > mask->ssid_last_tools) {
|
||||
pr_debug("diag: Msg SSID range mismatch\n");
|
||||
|
Loading…
Reference in New Issue
Block a user