From b8b164bb7332e26efae6d422403dafb8fae06e15 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 25 May 2004 23:36:03 +0000 Subject: [PATCH] ICU-3718 Don't read before the array (Fix from Ram) X-SVN-Rev: 15547 --- icu4c/source/common/uidna.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/icu4c/source/common/uidna.cpp b/icu4c/source/common/uidna.cpp index edc95417ba3..4fdb5521818 100644 --- a/icu4c/source/common/uidna.cpp +++ b/icu4c/source/common/uidna.cpp @@ -402,7 +402,7 @@ _internal_toUnicode(const UChar* src, int32_t srcLength, } srcLength++; } - }else{ + }else if(srcLength > 0){ for(int32_t j=0; j 0x7f){ srcIsASCII = FALSE; @@ -414,6 +414,8 @@ _internal_toUnicode(const UChar* src, int32_t srcLength, failPos = j; } } + }else{ + return 0; } if(srcIsASCII == FALSE){