Page MenuHomeFreeBSD

readdir: Fix error check.
ClosedPublic

Authored by des on Jul 11 2025, 8:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Sep 16, 10:38 PM
Unknown Object (File)
Sun, Sep 13, 6:26 PM
Unknown Object (File)
Aug 27 2026, 2:45 PM
Unknown Object (File)
Aug 23 2026, 8:39 AM
Unknown Object (File)
Aug 20 2026, 7:00 PM
Unknown Object (File)
Aug 18 2026, 9:01 PM
Unknown Object (File)
Aug 17 2026, 11:12 PM
Unknown Object (File)
Aug 17 2026, 7:42 AM
Subscribers

Details

Reviewers
kevans
Group Reviewers
Klara
Commits
rG920b2183919e: readdir: Fix error check.
Summary

Now that dd_size is unsigned, we need to check if the return value from
getdirentries() was negative before assigning it to dd_size.

While here, simplify the scandir_error test case slightly, and verify
that calling readdir() again after EOF still returns NULL.

Fixes: 42e613018da5
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 65363
Build 62246: arc lint + arc unit