]> granicus.if.org Git - icu/commitdiff
ICU-9567 Check for input status. Also use U_ILLEGAL_ARGUMENT_ERROR on null input.
authorYoshito Umaoka <y.umaoka@gmail.com>
Mon, 8 Oct 2012 18:06:41 +0000 (18:06 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Mon, 8 Oct 2012 18:06:41 +0000 (18:06 +0000)
X-SVN-Rev: 32551

icu4c/source/i18n/ucol.cpp

index 49f413cfb12a4a2f4722e48c379f8c36f2a893fe..54d5b4879f2539f086760c201c9f66e30a9770cb 100644 (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;
     }