Skip to content

Commit

Permalink
Fix out-of-bounds pointer arithmetic in CMSG_NXTHDR
Browse files Browse the repository at this point in the history
  • Loading branch information
purplesyringa committed May 1, 2024
1 parent 3939453 commit dc88f4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4650,7 +4650,7 @@ f! {
as *mut cmsghdr;
let max = (*mhdr).msg_control as usize
+ (*mhdr).msg_controllen as usize;
if (next.offset(1)) as usize > max ||
if (next.wrapping_offset(1)) as usize > max ||
next as usize + super::CMSG_ALIGN((*next).cmsg_len as usize) > max
{
0 as *mut cmsghdr
Expand Down

0 comments on commit dc88f4c

Please sign in to comment.