HomeFreeBSD

libutil: avoid an out-of-bounds read in trimdomain(3)

Description

libutil: avoid an out-of-bounds read in trimdomain(3)

memchr(3) will happily believe we've passed in a valid object, but
hostsize could easily exceed the bounds of fullhost. Clamp it down to
the string size to be safe and avoid UB. This plugs a potential
overread noted in the compat shim that was just added.

Reviewed by: des
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D54623

Details

Provenance
kevansAuthored on Tue, Mar 3, 10:51 PM
Reviewer
des
Differential Revision
D54623: libutil: avoid an out-of-bounds read in trimdomain(3)
Parents
rG7e70589b1bee: libutil: take a size_t in trimdomain()
Branches
Unknown
Tags
Unknown