]> git.ipfire.org Git - thirdparty/glibc.git/commit
posix: Falling back to non wide mode in case of encoding error [BZ #14185]
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 4 Jan 2021 17:26:30 +0000 (14:26 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 23 Feb 2021 18:58:04 +0000 (15:58 -0300)
commita79328c745219dcb395070cdcd3be065a8347f24
tree310d500264e2b219d91366544d0053f962a60df2
parent5a664d7ae8e42d641a7b4b436987ff67ab483b08
posix: Falling back to non wide mode in case of encoding error [BZ #14185]

Gnulib has added the proposed fix with aed23714d60 (done in 2005), but
recently with a glibc merge with 67306f6 (done in 2020 with sync back)
it has fallback to old semantic to return -1 on in case of failure.

From gnulib developer feedback it was an oversight.  Although the full
fix for BZ #14185 would require to rewrite fnmatch implementation to use
mbrtowc instead of mbsrtowcs on the full input, this mitigate the issue
and it has been used by gnulib for a long time.

This patch also removes the alloca usage on the string convertion to
wide characters before calling the internal function.

Checked on x86_64-linux-gnu.
posix/fnmatch.c
posix/tst-fnmatch.input