HomeFreeBSD

{ext2|ufs}_readdir: Avoid setting negative ncookies.

Description

{ext2|ufs}_readdir: Avoid setting negative ncookies.

ncookies cannot be negative or the allocator will fail. This should only
happen if a caller is very broken but we can still try to survive the
event.

We should probably also verify for uio_resid > MAXPHYS but in that case
it is not clear that just clipping the ncookies value is an adequate
response.

MFC after: 2 weeks

Details

Provenance
pfgAuthored on
Parents
rS328956: Use const pointers for input data not modified by clock utility functions.
Branches
Unknown
Tags
Unknown