HomeFreeBSD

Tighten boundary check in split(1) to prevent a potential buffer overflow.

Description

Tighten boundary check in split(1) to prevent a potential buffer overflow.

Before increasing sufflen, make sure the current name plus two (including
the terminating NUL character and the to-be-added character) does not
exceed the fixed buffer length, and stop immediately if this would occur.

In worst case scenario the code would write an nul character beyond the
boundary, however it would be caught by open(2) and based on the memory
layout, we do not believe this would constitute a security vulnerability.

MFC after: 3 days

Details

Provenance
Shawn Bayern <sbayern@law.fsu.edu>Authored on May 3 2024, 7:46 AM
delphijCommitted on May 3 2024, 8:29 AM
Parents
rGbf8988187f0d: pf tests: fix REQUIRED_MODULES typo
Branches
Unknown
Tags
Unknown