Skip to content
Commit 44f06ba8 authored by Jan Kara's avatar Jan Kara
Browse files

udf: Fix leak of UTF-16 surrogates into encoded strings



OSTA UDF specification does not mention whether the CS0 charset in case
of two bytes per character encoding should be treated in UTF-16 or
UCS-2. The sample code in the standard does not treat UTF-16 surrogates
in any special way but on systems such as Windows which work in UTF-16
internally, filenames would be treated as being in UTF-16 effectively.
In Linux it is more difficult to handle characters outside of Base
Multilingual plane (beyond 0xffff) as NLS framework works with 2-byte
characters only. Just make sure we don't leak UTF-16 surrogates into the
resulting string when loading names from the filesystem for now.

CC: stable@vger.kernel.org # >= v4.6
Reported-by: default avatarMingye Wang <arthur200126@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 06856938
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment