fs/exfat: use correct length for utf conversion
authorShiyong Li <a22381@motorola.com>
Sat, 9 Dec 2017 01:33:51 +0000 (17:33 -0800)
committerlingsen1 <lingsen1@lenovo.com>
Sun, 7 Feb 2021 09:36:50 +0000 (17:36 +0800)
commit90f25c2d36db8cc5a4f375666bf3f7e528f9cdcc
treed395963a5a91a6cdb79a0a77cb3eef735f41104d
parent374d48721461dc3f683605aaa2aa24c9ca0818e1
fs/exfat: use correct length for utf conversion

when call utf16s_to_utf8s, last parmater 'maxout' will be reduced
with the returned value of utf32_to_utf8, the value reflects the
size of one utf character, it could be 1~max charset size(3), so
maxout should use MAX_NAME_LENGTH * MAX_CHARSET_SIZE
when call utf8s_to_utf16s, the inlen will be reduced with the
the returned value of utf8_to_utf32, so it should use
MAX_NAME_LENGTH * MAX_CHARSET_SIZE or the lenghth of p_cstring whose
max value is MAX_NAME_LENGTH * MAX_CHARSET_SIZE.

Change-Id: Icbea02ece4b1a5b015037a6a54178ee8e08d4325
Signed-off-by: Shengzhe Zhao <a18689@motorola.com>
Signed-off-by: Shiyong Li <a22381@motorola.com>
Reviewed-on: https://gerrit.mot.com/1102180
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1276881
Reviewed-by: Hua Tan <tanhua1@motorola.com>
fs/exfat/exfat_nls.c