HomeFreeBSD

usr.bin/sort: Avoid UBSan errors

Description

usr.bin/sort: Avoid UBSan errors

UBSan complains about out-of-bounds accesses for zero-length arrays. To
avoid this we can use flexible array members. However, the C standard does
not allow for structures that only contain flexible array members, so we
move the length parameters into that structure too.

Split out from D28233.

Reviewed By: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31009

Details

Provenance
arichardsonAuthored on Jul 5 2021, 1:32 PM
Reviewer
markj
Differential Revision
D31009: usr.bin/sort: Avoid UBSan errors
Parents
rGa081a943a0ec: cam: drop unused 'saved_ccb' field from softcs
Branches
Unknown
Tags
Unknown