]> granicus.if.org Git - icu/commitdiff
ICU-11746 static analysis fixes
authorSteven R. Loomis <srl@icu-project.org>
Mon, 19 Sep 2016 18:52:48 +0000 (18:52 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Mon, 19 Sep 2016 18:52:48 +0000 (18:52 +0000)
X-SVN-Rev: 39282

icu4c/source/common/locid.cpp
icu4c/source/common/putil.cpp
icu4c/source/i18n/tznames_impl.cpp

index 9effbf88e4c01ac6800bc7f9eb33fedebc1d9145..0941fea8f24712c769002eb16e2b2fe1d65375b6 100644 (file)
@@ -664,6 +664,7 @@ Locale::setToBogus() {
     *script = 0;
     *country = 0;
     fIsBogus = TRUE;
+    variantBegin = 0;
 }
 
 const Locale& U_EXPORT2
index 4592edd0cf5a2297725084cf3cf4c5032b1d7a0f..ca1dd445b37019e0c173fde7d893dfa44664f7d9 100644 (file)
@@ -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;
index 157b294ff4fbccb25e9c39905c63bec0544ab507..f52d5c23ac350f9eee6f752c1a21c93c71d680ad 100644 (file)
@@ -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);
         }