# HG changeset patch # User Paul Fisher # Date 1751905825 14400 # Node ID 14708d9061dc124ac4b82121b2aa31ac81980cc5 # Parent 4b3a5095f68c37a0d214bedbc69a8085f1bd50ab Add safety section to BinaryPayload::total_bytes. diff -r 4b3a5095f68c -r 14708d9061dc libpam-sys/libpam-sys-helpers/src/lib.rs --- a/libpam-sys/libpam-sys-helpers/src/lib.rs Mon Jul 07 12:11:43 2025 -0400 +++ b/libpam-sys/libpam-sys-helpers/src/lib.rs Mon Jul 07 12:30:25 2025 -0400 @@ -340,6 +340,10 @@ } /// The total storage needed for the message, including header. + /// + /// # Safety + /// + /// The pointer must point to a valid `BinaryPayload`. pub unsafe fn total_bytes(this: *const Self) -> usize { let header = this.as_ref().unwrap_unchecked(); u32::from_be_bytes(header.total_bytes_u32be) as usize