Authors: Chris Morgan <cmorgan@wpi.edu>, James Abbatiello <abbeyj@wpi.edu>
Fixed HEADER_InsertItemA and HEADER_InsertItemW null pointer checking to handle wide character strings properly. Fix of our previous patch for null pointer checking.
This commit is contained in:
parent
89fd2dd1e8
commit
b1ee0461d7
|
@ -763,8 +763,11 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
if (phdi->mask & HDI_TEXT) {
|
if (phdi->mask & HDI_TEXT) {
|
||||||
if (!phdi->pszText) /* null pointer check */
|
if (!phdi->pszText) /* null pointer check */
|
||||||
phdi->pszText = "";
|
{
|
||||||
if (phdi->pszText != LPSTR_TEXTCALLBACKA) {
|
lpItem->pszText = COMCTL32_Alloc(sizeof(WCHAR));
|
||||||
|
lstrcpyAtoW(lpItem->pszText, "");
|
||||||
|
}
|
||||||
|
else if (phdi->pszText != LPSTR_TEXTCALLBACKA) {
|
||||||
len = lstrlenA (phdi->pszText);
|
len = lstrlenA (phdi->pszText);
|
||||||
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
|
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
|
||||||
lstrcpyAtoW (lpItem->pszText, phdi->pszText);
|
lstrcpyAtoW (lpItem->pszText, phdi->pszText);
|
||||||
|
@ -849,8 +852,11 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
if (phdi->mask & HDI_TEXT) {
|
if (phdi->mask & HDI_TEXT) {
|
||||||
if (!phdi->pszText) /* null pointer check */
|
if (!phdi->pszText) /* null pointer check */
|
||||||
phdi->pszText = "";
|
{
|
||||||
if (phdi->pszText != LPSTR_TEXTCALLBACKW) {
|
lpItem->pszText = COMCTL32_Alloc(sizeof(WCHAR));
|
||||||
|
lstrcpyAtoW(lpItem->pszText, "");
|
||||||
|
}
|
||||||
|
else if (phdi->pszText != LPSTR_TEXTCALLBACKW) {
|
||||||
len = lstrlenW (phdi->pszText);
|
len = lstrlenW (phdi->pszText);
|
||||||
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
|
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
|
||||||
lstrcpyW (lpItem->pszText, phdi->pszText);
|
lstrcpyW (lpItem->pszText, phdi->pszText);
|
||||||
|
|
Loading…
Reference in New Issue