CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2026/11/25 09:20:50

Modified files:
        lib/libc/gen   : glob.c 

Log message:
glob.c: Fix potential out-of-bounds write for GLOB_NOSPACE error

When the GLOB_LIMIT option is specified, glob returns the GLOB_NOSPACE
error when hitting either the GLOB_LIMIT_STAT or GLOB_LIMIT_READDIR
limits.  Before returning the error, glob stored the path separator
and NUL terminating the result before returning.  If we are at the
very end of the path buffer, it is possible for this to write past
the end of the buffer.  Change this to just return GLOB_NOSPACE
when the limit is reached without writing the path separator or NUL
terminator.

OK djm@

Reported by ozgun kultekin

Reply via email to