Changeset 204502 in webkit
- Timestamp:
- Aug 16, 2016 2:43:04 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r204501 r204502 1 2016-08-16 Per Arne Vollan <pvollan@apple.com> 2 3 [Win] Hardening of getLinkedFonts function. 4 https://bugs.webkit.org/show_bug.cgi?id=160850 5 6 The SUCCEEDED macro should only be used for functions returning a HRESULT type. 7 Also, make sure a string array index will not exceed the string length. 8 9 * platform/graphics/win/FontCacheWin.cpp: 10 (WebCore::getLinkedFonts): 11 1 12 2016-08-16 Alex Christensen <achristensen@webkit.org> 2 13 -
trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp
r201979 r204502 117 117 118 118 WCHAR* linkedFonts = reinterpret_cast<WCHAR*>(malloc(linkedFontsBufferSize)); 119 if ( SUCCEEDED(RegQueryValueEx(fontLinkKey, family.charactersWithNullTermination().data(), 0, NULL, reinterpret_cast<BYTE*>(linkedFonts), &linkedFontsBufferSize))) {119 if (::RegQueryValueEx(fontLinkKey, family.charactersWithNullTermination().data(), 0, nullptr, reinterpret_cast<BYTE*>(linkedFonts), &linkedFontsBufferSize) == ERROR_SUCCESS) { 120 120 unsigned i = 0; 121 121 unsigned length = linkedFontsBufferSize / sizeof(*linkedFonts); … … 123 123 while (i < length && linkedFonts[i] != ',') 124 124 i++; 125 // Break if we did not find a comma. 126 if (i == length) 127 break; 125 128 i++; 126 129 unsigned j = i;
Note: See TracChangeset
for help on using the changeset viewer.