The following issues were found
src/third_party/icu4c-57.1/source/i18n/collationdatareader.cpp
1 issues
Line: 45
Column: 22
CWE codes:
120
20
} // namespace
void
CollationDataReader::read(const CollationTailoring *base, const uint8_t *inBytes, int32_t inLength,
CollationTailoring &tailoring, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) { return; }
if(base != NULL) {
if(inBytes == NULL || (0 <= inLength && inLength < 24)) {
errorCode = U_ILLEGAL_ARGUMENT_ERROR;
Reported by FlawFinder.
src/third_party/icu4c-57.1/source/i18n/collationdatareader.h
1 issues
Line: 100
Column: 17
CWE codes:
120
20
IX_TOTAL_SIZE
};
static void read(const CollationTailoring *base, const uint8_t *inBytes, int32_t inLength,
CollationTailoring &tailoring, UErrorCode &errorCode);
static UBool U_CALLCONV
isAcceptable(void *context, const char *type, const char *name, const UDataInfo *pInfo);
Reported by FlawFinder.
src/third_party/icu4c-57.1/source/i18n/collationfastlatin.cpp
1 issues
Line: 885
CWE codes:
476
}
}
} else {
c2 = s8[nextIndex++];
if(c2 > 0x7f) {
uint8_t t;
if(c2 <= 0xc5 && 0xc2 <= c2 && nextIndex != sLength &&
0x80 <= (t = s8[nextIndex]) && t <= 0xbf) {
c2 = ((c2 - 0xc2) << 6) + t; // 0080..017F
Reported by Cppcheck.
src/third_party/icu4c-57.1/source/i18n/collationkeys.cpp
1 issues
Line: 334
Column: 17
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
}
char p2 = (char)(p >> 16);
if(p2 != 0) {
char buffer[3] = { p2, (char)(p >> 8), (char)p };
sink.Append(buffer, (buffer[1] == 0) ? 1 : (buffer[2] == 0) ? 2 : 3);
}
// Optimization for internalNextSortKeyPart():
// When the primary level overflows we can stop because we need not
// calculate (preflight) the whole sort key length.
Reported by FlawFinder.
src/third_party/icu4c-57.1/source/i18n/collationroot.cpp
1 issues
Line: 61
Column: 26
CWE codes:
120
20
CollationDataReader::isAcceptable, t->version, &errorCode);
if(U_FAILURE(errorCode)) { return; }
const uint8_t *inBytes = static_cast<const uint8_t *>(udata_getMemory(t->memory));
CollationDataReader::read(NULL, inBytes, udata_getLength(t->memory), *t, errorCode);
if(U_FAILURE(errorCode)) { return; }
ucln_i18n_registerCleanup(UCLN_I18N_COLLATION_ROOT, uprv_collation_root_cleanup);
CollationCacheEntry *entry = new CollationCacheEntry(Locale::getRoot(), t.getAlias());
if(entry != NULL) {
t.orphan(); // The rootSingleton took ownership of the tailoring.
Reported by FlawFinder.
src/third_party/icu4c-57.1/source/i18n/compactdecimalformat.cpp
1 issues
Line: 163
static CDFUnit* createCDFUnit(const char* variant, int32_t log10Value, UHashtable* table, UErrorCode& status);
static const CDFUnit* getCDFUnitFallback(const UHashtable* table, const UnicodeString& variant, int32_t log10Value);
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CompactDecimalFormat)
CompactDecimalFormat::CompactDecimalFormat(
const DecimalFormat& decimalFormat,
const UHashtable* unitsByVariant,
const double* divisors,
Reported by Cppcheck.
src/third_party/icu4c-57.1/source/i18n/cpdtrans.cpp
1 issues
Line: 33
const UChar CompoundTransliterator::PASS_STRING[] = { 0x0025, 0x0050, 0x0061, 0x0073, 0x0073, 0 }; // "%Pass"
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CompoundTransliterator)
/**
* Constructs a new compound transliterator given an array of
* transliterators. The array of transliterators may be of any
* length, including zero or one, however, useful compound
Reported by Cppcheck.
src/third_party/icu4c-57.1/source/i18n/currpinf.cpp
1 issues
Line: 302
Column: 21
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
if (U_SUCCESS(err) && ptnLen > 0) {
UnicodeString* pattern = new UnicodeString(patternChars, ptnLen);
#ifdef CURRENCY_PLURAL_INFO_DEBUG
char result_1[1000];
pattern->extract(0, pattern->length(), result_1, "UTF-8");
std::cout << "pluralCount: " << pluralCount << "; pattern: " << result_1 << "\n";
#endif
pattern->findAndReplace(UnicodeString(TRUE, gPart0, 3),
UnicodeString(numberStylePattern, numberStylePatternLen));
Reported by FlawFinder.
src/third_party/icu4c-57.1/source/i18n/currunit.cpp
1 issues
Line: 25
Column: 13
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
if (U_SUCCESS(ec)) {
if (_isoCode && u_strlen(_isoCode)==3) {
u_strcpy(isoCode, _isoCode);
char simpleIsoCode[4];
u_UCharsToChars(isoCode, simpleIsoCode, 4);
initCurrency(simpleIsoCode);
} else {
ec = U_ILLEGAL_ARGUMENT_ERROR;
}
Reported by FlawFinder.
src/third_party/icu4c-57.1/source/i18n/datefmt.cpp
1 issues
Line: 500
Column: 5
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
{
UErrorCode status = U_ZERO_ERROR;
#if U_PLATFORM_HAS_WIN32_API
char buffer[8];
int32_t count = locale.getKeywordValue("compat", buffer, sizeof(buffer), status);
// if the locale has "@compat=host", create a host-specific DateFormat...
if (count > 0 && uprv_strcmp(buffer, "host") == 0) {
Win32DateFormat *f = new Win32DateFormat(timeStyle, dateStyle, locale, status);
Reported by FlawFinder.