Changeset 170513 in webkit
- Timestamp:
- Jun 26, 2014, 6:10:48 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r170512 r170513 1 2014-06-26 David Kilzer <ddkilzer@apple.com> 2 3 [Win] Always NULL-terminate the string in createUTF8String() 4 <http://webkit.org/b/134353> 5 <rdar://problem/17471783> 6 7 Reviewed by Brent Fulgham. 8 9 * plugins/PluginView.cpp: 10 (WebCore::createUTF8String): Pull out CString length into local 11 variable. Switch to use memcpy. Always NULL-terminate the 12 string. 13 1 14 2014-06-26 Jer Noble <jer.noble@apple.com> 2 15 -
trunk/Source/WebCore/plugins/PluginView.cpp
r170025 r170513 410 410 { 411 411 CString cstr = str.utf8(); 412 char* result = reinterpret_cast<char*>(fastMalloc(cstr.length() + 1)); 413 414 strncpy(result, cstr.data(), cstr.length() + 1); 412 const size_t cstrLength = cstr.length(); 413 char* result = reinterpret_cast<char*>(fastMalloc(cstrLength + 1)); 414 415 memcpy(result, cstr.data(), cstrLength); 416 result[cstrLength] = '\0'; 415 417 416 418 return result;
Note:
See TracChangeset
for help on using the changeset viewer.