diff --git a/icu4c/source/test/intltest/idnaref.cpp b/icu4c/source/test/intltest/idnaref.cpp index ed4fec1baeb..90803970f05 100644 --- a/icu4c/source/test/intltest/idnaref.cpp +++ b/icu4c/source/test/intltest/idnaref.cpp @@ -172,7 +172,7 @@ static int32_t convertToPuny(const UChar* src, int32_t srcLength, goto CLEANUP; } - caseFlags = (unsigned char*) uprv_malloc(b1Len *sizeof(unsigned char)); + //caseFlags = (unsigned char*) uprv_malloc(b1Len *sizeof(unsigned char)); error = punycode_encode(b1Len,b1,caseFlags, (uint32_t*)&b2Len, b2); status = getError(error); @@ -224,7 +224,7 @@ static int32_t convertFromPuny( const UChar* src, int32_t srcLength, uint32_t b2Stack[MAX_LABEL_BUFFER_SIZE]; uint32_t* b2 = b2Stack; int32_t b2Len =MAX_LABEL_BUFFER_SIZE; - unsigned char* caseFlags = (unsigned char*) uprv_malloc(srcLength * sizeof(unsigned char*)); + unsigned char* caseFlags = NULL; //(unsigned char*) uprv_malloc(srcLength * sizeof(unsigned char*)); punycode_status error = punycode_decode(srcLength,b1,(uint32_t*)&b2Len,b2,caseFlags); status = getError(error); if(status == U_BUFFER_OVERFLOW_ERROR){ @@ -345,7 +345,7 @@ idnaref_toASCII(const UChar* src, int32_t srcLength, if(!startsWithPrefix(b1,b1Len)){ //step 6: encode the sequence with punycode - caseFlags = (UBool*) uprv_malloc(b1Len * sizeof(UBool)); + //caseFlags = (UBool*) uprv_malloc(b1Len * sizeof(UBool)); b2Len = convertToPuny(b1,b1Len, b2,b2Capacity,*status); //b2Len = u_strToPunycode(b2,b2Capacity,b1,b1Len, caseFlags, status); diff --git a/icu4c/source/test/intltest/testidna.cpp b/icu4c/source/test/intltest/testidna.cpp index a22fe378387..e6d7f78aa81 100644 --- a/icu4c/source/test/intltest/testidna.cpp +++ b/icu4c/source/test/intltest/testidna.cpp @@ -1462,13 +1462,13 @@ void TestIDNA::testCompareReferenceImpl(const UChar* src, int32_t srcLen){ { const UChar* labelUChars = label.getBuffer(); - UChar ascii[MAX_DEST_SIZE]; + UChar ascii[MAX_DEST_SIZE]={0}; int32_t asciiCapacity = MAX_DEST_SIZE, asciiLen=0; - UChar uni[MAX_DEST_SIZE]; + UChar uni[MAX_DEST_SIZE]={0}; int32_t uniCapacity = MAX_DEST_SIZE, uniLen=0; UErrorCode expectedStatus = U_ZERO_ERROR; UParseError parseError; - ascii[0] = uni[0] =0; + //ascii[0] = uni[0] =0; logln("Comparing idnaref_toASCII with uidna_toASCII for input: " + prettify(label)); asciiLen = idnaref_toASCII(labelUChars, label.length()-1,ascii,asciiCapacity,