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 Fri, May 3, 7:46 AM
delphijCommitted on Fri, May 3, 8:29 AM
Parents
rGbf8988187f0d: pf tests: fix REQUIRED_MODULES typo
Branches
Unknown
Tags
Unknown