HomeFreeBSD

g_Ctoc() conversion buffers are smaller than needed up to MB_CUR_MAX - 1

Description

g_Ctoc() conversion buffers are smaller than needed up to MB_CUR_MAX - 1
since whole conversion needs a room for (len >= MB_CUR_MAX). It is no
difference when MB_CUR_MAX == 1, but for multi-byte locales last few chars
('\0' and before) may need just one byte, and the rest of MB_CUR_MAX - 1
space becomes unavailable in the MAXPATHLEN-sized buffer, which cause
conversion error on near MAXPATHLEN long pathes.

Increase g_Ctoc() conversion buffers to MB_LEN_MAX - 1.

Details

Provenance
acheAuthored on
Parents
rS303012: Add ipfw_nptv6 module that implements Network Prefix Translation for IPv6
Branches
Unknown
Tags
Unknown