ICU-9567 Check for input status. Also use U_ILLEGAL_ARGUMENT_ERROR on null input.

X-SVN-Rev: 32551
This commit is contained in:
Yoshito Umaoka 2012-10-08 18:06:41 +00:00
parent 0963e7f300
commit 7c176da599

View File

@ -8876,9 +8876,14 @@ ucol_strcollUTF8(
UTRACE_DATA2(UTRACE_VERBOSE, "target string = %vb ", target, targetLength);
}
if (U_FAILURE(*status)) {
/* do nothing */
UTRACE_EXIT_VALUE(UCOL_EQUAL);
return UCOL_EQUAL;
}
if(source == NULL || target == NULL) {
// do not crash, but return. Should have
// status argument to return error.
*status = U_ILLEGAL_ARGUMENT_ERROR;
UTRACE_EXIT_VALUE(UCOL_EQUAL);
return UCOL_EQUAL;
}