Skip to content

Commit 5b97c18

Browse files
authored
Fix the definition of CMSG_NXTHDR. (#92)
Use the correct `cmsg_len` value when testing for the end of the iteration sequence.
1 parent 8e09800 commit 5b97c18

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub mod cmsg_macros {
141141
}
142142

143143
if next_cmsg.add(1) as usize > max
144-
|| next_cmsg as usize + CMSG_ALIGN(cmsg_len as _) as usize > max
144+
|| next_cmsg as usize + CMSG_ALIGN((*next_cmsg).cmsg_len as _) as usize > max
145145
{
146146
return ptr::null_mut();
147147
}

0 commit comments

Comments
 (0)