From 9f63dce8815693b20cef63a205e19913c06a077a Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Mon, 14 Aug 2000 23:05:10 +0000 Subject: [PATCH] ICU-471 improve checks for preflighting X-SVN-Rev: 2228 --- icu4c/source/common/ushape.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/icu4c/source/common/ushape.c b/icu4c/source/common/ushape.c index 6b3e35e627..9b9ca69fe3 100644 --- a/icu4c/source/common/ushape.c +++ b/icu4c/source/common/ushape.c @@ -101,8 +101,9 @@ u_shapeArabic(const UChar *source, int32_t sourceLength, return 0; } - /* also make sure that no reserved options values are used */ - if( source==NULL || sourceLength<-1 || dest==NULL || destSize<0 || + /* make sure that no reserved options values are used; allow dest==NULL only for preflighting */ + if( source==NULL || sourceLength<-1 || + dest==NULL && destSize!=0 || destSize<0 || options>=U_SHAPE_DIGIT_TYPE_RESERVED || (options&U_SHAPE_LENGTH_MASK)==U_SHAPE_LENGTH_RESERVED || (options&U_SHAPE_LETTERS_MASK)==U_SHAPE_LETTERS_RESERVED || @@ -121,8 +122,9 @@ u_shapeArabic(const UChar *source, int32_t sourceLength, } /* check that source and destination do not overlap */ - if( source<=dest && dest