From cc1823680e9a51157b3c43676e70d619ea1ccc37 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Fri, 31 Dec 2004 08:29:56 +0000 Subject: [PATCH] ICU-4092 Fix swap function so that it works like the other swap functions. X-SVN-Rev: 17053 --- icu4c/source/common/rbbidata.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/icu4c/source/common/rbbidata.cpp b/icu4c/source/common/rbbidata.cpp index aa33c610cab..03553f82bd5 100644 --- a/icu4c/source/common/rbbidata.cpp +++ b/icu4c/source/common/rbbidata.cpp @@ -267,6 +267,10 @@ ubrk_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *outD if (status == NULL || U_FAILURE(*status)) { return 0; } + if(ds==NULL || inData==NULL || length<-1 || (length>0 && outData==NULL)) { + *status=U_ILLEGAL_ARGUMENT_ERROR; + return 0; + } // // Check that the data header is for for break data.