Chromium Code Reviews| Index: Source/wtf/text/StringImpl.cpp |
| diff --git a/Source/wtf/text/StringImpl.cpp b/Source/wtf/text/StringImpl.cpp |
| index fcb64d3f0505a8059f53faaa5355323b1c01d7d5..a7f8364e0ca1b8a9fc5b5870d326b5fd2d69544a 100644 |
| --- a/Source/wtf/text/StringImpl.cpp |
| +++ b/Source/wtf/text/StringImpl.cpp |
| @@ -689,13 +689,15 @@ typedef int32_t (*icuCaseConverter)(UChar*, int32_t, const UChar*, int32_t, cons |
| static PassRefPtr<StringImpl> caseConvert(const UChar* source16, size_t length, icuCaseConverter converter, const char* locale, StringImpl* originalString) |
| { |
| UChar* data16; |
| - int32_t targetLength = length; |
| + size_t targetLength = length; |
| RefPtr<StringImpl> output = StringImpl::createUninitialized(length, data16); |
| do { |
| UErrorCode status = U_ZERO_ERROR; |
| targetLength = converter(data16, targetLength, source16, length, locale, &status); |
| if (U_SUCCESS(status)) { |
| - output->truncateAssumingIsolated(targetLength); |
| + ASSERT(targetLength <= length); |
|
tkent
2014/11/25 00:41:22
This assertion is not correct.
input: ß (length=
|
| + if (length > 0) |
| + output->truncateAssumingIsolated(targetLength); |
| return output.release(); |
| } |
| if (status != U_BUFFER_OVERFLOW_ERROR) |