Changeset 69414 in webkit for trunk/JavaScriptCore/wtf/text/WTFString.cpp
- Timestamp:
- Oct 8, 2010, 12:38:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/text/WTFString.cpp
r67012 r69414 49 49 return; 50 50 51 int len = 0;51 size_t len = 0; 52 52 while (str[len] != UChar(0)) 53 53 len++; 54 55 if (len > std::numeric_limits<unsigned>::max()) 56 CRASH(); 54 57 55 58 m_impl = StringImpl::create(str, len); … … 176 179 ASSERT(charactersToAppend); 177 180 UChar* data; 181 if (lengthToAppend > std::numeric_limits<unsigned>::max() - length()) 182 CRASH(); 178 183 RefPtr<StringImpl> newImpl = 179 184 StringImpl::createUninitialized(length() + lengthToAppend, data); … … 197 202 ASSERT(charactersToInsert); 198 203 UChar* data; 204 if (lengthToInsert > std::numeric_limits<unsigned>::max() - length()) 205 CRASH(); 199 206 RefPtr<StringImpl> newImpl = 200 207 StringImpl::createUninitialized(length() + lengthToInsert, data); … … 719 726 String String::fromUTF8(const char* stringStart, size_t length) 720 727 { 728 if (length > std::numeric_limits<unsigned>::max()) 729 CRASH(); 730 721 731 if (!stringStart) 722 732 return String();
Note:
See TracChangeset
for help on using the changeset viewer.