mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 05:03:05 +00:00
sys_util: netlink: fix wrong setting of the netlink msg data end boundary
The netlink data end boundary should be actually set by msg_len. The previous calculation of data_end and its usage was probably confused with data size. This bug prevented access to the entire netlink's message data. BUG=b:197247746 TEST=Build and print the `data` when netlink message arrives. Change-Id: I601bcfee9132649f48f774e23426281ba1e88fde Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3375544 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
477459aea6
commit
2c0459db66
1 changed files with 1 additions and 2 deletions
|
@ -56,8 +56,7 @@ impl<'a> Iterator for NetlinkMessageIter<'a> {
|
|||
|
||||
// NLMSG_DATA
|
||||
let data_start = HDR_SIZE;
|
||||
let data_end = msg_len - data_start;
|
||||
let data = &self.data[data_start..data_end];
|
||||
let data = &self.data[data_start..msg_len];
|
||||
|
||||
// NLMSG_NEXT
|
||||
let align_to = std::mem::align_of::<NlMsgHdr>();
|
||||
|
|
Loading…
Reference in a new issue