Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix bug in CMSG_NXTHDR for android. CMSG_NXTHDR should return NUL…
…L if it is the last control message in the chain.
  • Loading branch information
LinkTed committed Nov 15, 2020
commit 724d1a33a076dc58e65deb5f2fc7f2695a21c843
3 changes: 3 additions & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2289,6 +2289,9 @@ pub const PF_VSOCK: ::c_int = AF_VSOCK;
f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
cmsg: *const cmsghdr) -> *mut cmsghdr {
if ((*cmsg).cmsg_len as usize) < ::mem::size_of::<cmsghdr>() {
return 0 as *mut cmsghdr;
};
let next = (cmsg as usize
+ super::CMSG_ALIGN((*cmsg).cmsg_len as usize))
as *mut cmsghdr;
Expand Down