From: Steven R. Loomis Date: Mon, 19 Sep 2016 18:52:48 +0000 (+0000) Subject: ICU-11746 static analysis fixes X-Git-Tag: milestone-59-0-1~187 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2ee3b1f281fd71636a08ef1e68ceb7c0e6484ec;p=icu ICU-11746 static analysis fixes X-SVN-Rev: 39282 --- diff --git a/icu4c/source/common/locid.cpp b/icu4c/source/common/locid.cpp index 9effbf88e4c..0941fea8f24 100644 --- a/icu4c/source/common/locid.cpp +++ b/icu4c/source/common/locid.cpp @@ -664,6 +664,7 @@ Locale::setToBogus() { *script = 0; *country = 0; fIsBogus = TRUE; + variantBegin = 0; } const Locale& U_EXPORT2 diff --git a/icu4c/source/common/putil.cpp b/icu4c/source/common/putil.cpp index 4592edd0cf5..ca1dd445b37 100644 --- a/icu4c/source/common/putil.cpp +++ b/icu4c/source/common/putil.cpp @@ -1030,7 +1030,7 @@ uprv_tzname(int n) because the tzfile contents is underspecified. This isn't guaranteed to work because it may not be a symlink. */ - int32_t ret = (int32_t)readlink(TZDEFAULT, gTimeZoneBuffer, sizeof(gTimeZoneBuffer)); + int32_t ret = (int32_t)readlink(TZDEFAULT, gTimeZoneBuffer, sizeof(gTimeZoneBuffer)-1); if (0 < ret) { int32_t tzZoneInfoLen = uprv_strlen(TZZONEINFO); gTimeZoneBuffer[ret] = 0; diff --git a/icu4c/source/i18n/tznames_impl.cpp b/icu4c/source/i18n/tznames_impl.cpp index 157b294ff4f..f52d5c23ac3 100644 --- a/icu4c/source/i18n/tznames_impl.cpp +++ b/icu4c/source/i18n/tznames_impl.cpp @@ -1822,7 +1822,7 @@ TZDBNames::createInstance(UResourceBundle* rb, const char* key) { if (regions != NULL) { char **p = regions; for (int32_t i = 0; i < numRegions; p++, i++) { - uprv_free(p); + uprv_free(*p); } uprv_free(regions); }