diff options
Diffstat (limited to 'src/dutil/thmutil.cpp')
| -rw-r--r-- | src/dutil/thmutil.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dutil/thmutil.cpp b/src/dutil/thmutil.cpp index d87e997d..d200a0ea 100644 --- a/src/dutil/thmutil.cpp +++ b/src/dutil/thmutil.cpp | |||
| @@ -1519,13 +1519,16 @@ DAPI_(HRESULT) ThemeGetTextControl( | |||
| 1519 | { | 1519 | { |
| 1520 | HRESULT hr = S_OK; | 1520 | HRESULT hr = S_OK; |
| 1521 | HWND hWnd = ::GetDlgItem(pTheme->hwndParent, dwControl); | 1521 | HWND hWnd = ::GetDlgItem(pTheme->hwndParent, dwControl); |
| 1522 | SIZE_T cbSize = 0; | ||
| 1522 | DWORD cchText = 0; | 1523 | DWORD cchText = 0; |
| 1523 | DWORD cchTextRead = 0; | 1524 | DWORD cchTextRead = 0; |
| 1524 | 1525 | ||
| 1525 | // Ensure the string has room for at least one character. | 1526 | // Ensure the string has room for at least one character. |
| 1526 | hr = StrMaxLength(*psczText, reinterpret_cast<DWORD_PTR*>(&cchText)); | 1527 | hr = StrMaxLength(*psczText, &cbSize); |
| 1527 | ThmExitOnFailure(hr, "Failed to get text buffer length."); | 1528 | ThmExitOnFailure(hr, "Failed to get text buffer length."); |
| 1528 | 1529 | ||
| 1530 | cchText = (DWORD)min(DWORD_MAX, cbSize); | ||
| 1531 | |||
| 1529 | if (!cchText) | 1532 | if (!cchText) |
| 1530 | { | 1533 | { |
| 1531 | cchText = GROW_WINDOW_TEXT; | 1534 | cchText = GROW_WINDOW_TEXT; |
