diff --git a/icu4c/source/common/ucol_swp.cpp b/icu4c/source/common/ucol_swp.cpp index cf4d5519b3e..7c3addd0ddc 100644 --- a/icu4c/source/common/ucol_swp.cpp +++ b/icu4c/source/common/ucol_swp.cpp @@ -156,7 +156,7 @@ ucol_swapBinary(const UDataSwapper *ds, const UCATableHeader *inHeader; UCATableHeader *outHeader; - UCATableHeader header={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, 0 }; + UCATableHeader header; uint32_t count; @@ -181,6 +181,7 @@ ucol_swapBinary(const UDataSwapper *ds, * sizeof(UCATableHeader)==42*4 in ICU 2.8 * check the length against the header size before reading the size field */ + uprv_memset(&header, 0, sizeof(header)); if(length<0) { header.size=udata_readInt32(ds, inHeader->size); } else if((length<(42*4) || length<(header.size=udata_readInt32(ds, inHeader->size)))) { diff --git a/icu4c/source/test/cintltst/cstrtest.c b/icu4c/source/test/cintltst/cstrtest.c index 44837dde3fc..afef9d33ad1 100644 --- a/icu4c/source/test/cintltst/cstrtest.c +++ b/icu4c/source/test/cintltst/cstrtest.c @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 1998-2009, International Business Machines Corporation +* Copyright (C) 1998-2010, International Business Machines Corporation * and others. All Rights Reserved. ********************************************************************** * @@ -302,25 +302,25 @@ TestCompareInvEbcdicAsAscii() { static const char *const invStrings[][2]={ /* invariant-character strings in ascending ASCII order */ /* EBCDIC native */ - "", "", - "\x6c", "%", - "\xf0", "0", - "\xf0\xf0", "00", - "\xf0\xf0\x81", "00a", - "\x7e", "=", - "\xc1", "A", - "\xc1\xf0\xf0", "A00", - "\xc1\xf0\xf0", "A00", - "\xc1\xc1", "AA", - "\xc1\xc1\xf0", "AA0", - "\x6d", "_", - "\x81", "a", - "\x81\xf0\xf0", "a00", - "\x81\xf0\xf0", "a00", - "\x81\x81", "aa", - "\x81\x81\xf0", "aa0", - "\x81\x81\x81", "aaa", - "\x81\x81\x82", "aab" + { "", "" }, + { "\x6c", "%" }, + { "\xf0", "0" }, + { "\xf0\xf0", "00" }, + { "\xf0\xf0\x81", "00a" }, + { "\x7e", "=" }, + { "\xc1", "A" }, + { "\xc1\xf0\xf0", "A00" }, + { "\xc1\xf0\xf0", "A00" }, + { "\xc1\xc1", "AA" }, + { "\xc1\xc1\xf0", "AA0" }, + { "\x6d", "_" }, + { "\x81", "a" }, + { "\x81\xf0\xf0", "a00" }, + { "\x81\xf0\xf0", "a00" }, + { "\x81\x81", "aa" }, + { "\x81\x81\xf0", "aa0" }, + { "\x81\x81\x81", "aaa" }, + { "\x81\x81\x82", "aab" } }; int32_t i; for(i=1; i