]> granicus.if.org Git - icu/commitdiff
ICU-13008 Signed int overflow (undefined behavior) in datefmt.cpp
authorAndy Heninger <andy.heninger@gmail.com>
Wed, 1 Mar 2017 21:59:38 +0000 (21:59 +0000)
committerAndy Heninger <andy.heninger@gmail.com>
Wed, 1 Mar 2017 21:59:38 +0000 (21:59 +0000)
X-SVN-Rev: 39718

icu4c/source/i18n/datefmt.cpp

index 60681403af3aaaec1f9c68eca2b4ec4933dae3a4..7dc753f141182e6ebcbdf3312542d576dc8d7fa5 100644 (file)
@@ -80,7 +80,7 @@ public:
             fSkeleton(other.fSkeleton) { }
     virtual ~DateFmtBestPatternKey();
     virtual int32_t hashCode() const {
-        return 37 * LocaleCacheKey<DateFmtBestPattern>::hashCode() + fSkeleton.hashCode();
+        return (int32_t)(37u * (uint32_t)LocaleCacheKey<DateFmtBestPattern>::hashCode() + (uint32_t)fSkeleton.hashCode());
     }
     virtual UBool operator==(const CacheKeyBase &other) const {
        // reflexive