Fix OOB read for registerLocaleList

When the buffer size is equal to string size,
the func in icu just return warning U_STRING_NOT_TERMINATED_WARNING
which is a negative number, and U_FAILURE would fail if error number
greater than zero only.

This would cause non null terminated string passing into following funcs
and causing different types of crash

Bug: 239210579
Bug: 239328580
Bug: 239267173
Test: locale_fuzzer
Ignore-AOSP-First: security
Merged-In: Id9c98fc08876656e1f48d12823a24bb7a44bee45
Change-Id: Id9c98fc08876656e1f48d12823a24bb7a44bee45
(cherry picked from commit 4d7fc6307bf1c7060efd4b26159397b961120b24)
(cherry picked from commit d5d0c70c3c73167a6564dc3e8843ab1f567b4676)
Merged-In: Id9c98fc08876656e1f48d12823a24bb7a44bee45
1 file changed