Skip to content

Commit dc88f4c

Browse files
committed
Fix out-of-bounds pointer arithmetic in CMSG_NXTHDR
1 parent 3939453 commit dc88f4c

File tree

1 file changed

+1
-1
lines changed
  • src/unix/linux_like/linux

1 file changed

+1
-1
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4650,7 +4650,7 @@ f! {
46504650
as *mut cmsghdr;
46514651
let max = (*mhdr).msg_control as usize
46524652
+ (*mhdr).msg_controllen as usize;
4653-
if (next.offset(1)) as usize > max ||
4653+
if (next.wrapping_offset(1)) as usize > max ||
46544654
next as usize + super::CMSG_ALIGN((*next).cmsg_len as usize) > max
46554655
{
46564656
0 as *mut cmsghdr

0 commit comments

Comments
 (0)