fs/exfat: avoid setting 0 over buffer uniname
authorShiyong Li <a22381@motorola.com>
Sat, 9 Dec 2017 01:32:02 +0000 (17:32 -0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:30:25 +0000 (17:30 +0800)
commit696fb98ba6c611c258a7b461f3cdb16fd192e293
tree1dc66e95b347c131c7b4162bda94926291c3401a
parentf872984ac44b26399dd8282e43d2e5c177249221
fs/exfat: avoid setting 0 over buffer uniname

utf8s_to_utf16s could return -EINVAL(-22), then uniname[i] =
uniname[-22] = '\0' will corrupt other local variable.
uniname is a local variable having different address everytime
when call nls_cstring_to_uniname. so uniname[-22] could corrupt
some different addresses.
and also when filename reaches at maximum length, need to leave
last one space in buffer for '\0'

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