mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:15:41 +00:00
[WIN32K] Fix a possible NULL pointer dereference in co_IntGetScrollBarInfo
The following code in user32_winetest scroll.c was causing it: ret = EnableScrollBar( mainwnd, SB_CTL, ESB_ENABLE_BOTH ); ok( !ret, "EnableScrollBar should fail.\n" );
This commit is contained in:
parent
6a28201e3d
commit
c36d8c9271
1 changed files with 11 additions and 0 deletions
|
@ -495,6 +495,11 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
|
|||
psbi = IntGetScrollbarInfoFromWindow(Window, nBar);
|
||||
Info = IntGetScrollInfoFromWindow(Window, nBar);
|
||||
pSBData = IntGetSBData(Window, nBar);
|
||||
if (pSBData == NULL)
|
||||
{
|
||||
ERR("co_IntSetScrollInfo: No SBDATA for window %p, bar %d\n", UserHMGetHandle(Window), nBar);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (lpsi->fMask & SIF_THEMED && !(Info->fMask & SIF_THEMED))
|
||||
Info->fMask |= SIF_THEMED;
|
||||
|
@ -687,6 +692,11 @@ co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
|
|||
|
||||
sbi = IntGetScrollbarInfoFromWindow(Window, Bar);
|
||||
pSBData = IntGetSBData(Window, Bar);
|
||||
if (pSBData == NULL)
|
||||
{
|
||||
ERR("co_IntGetScrollBarInfo: No scrollbar info for window %p, bar %d\n", UserHMGetHandle(Window), Bar);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
IntGetScrollBarRect(Window, Bar, &(sbi->rcScrollBar));
|
||||
IntCalculateThumb(Window, Bar, sbi, pSBData);
|
||||
|
@ -787,6 +797,7 @@ co_IntCreateScrollBars(PWND Window)
|
|||
psbi->rgstate[i] = 0;
|
||||
|
||||
pSBData = IntGetSBData(Window, s);
|
||||
ASSERT(pSBData != NULL);
|
||||
|
||||
IntGetScrollBarRect(Window, s, &(psbi->rcScrollBar));
|
||||
IntCalculateThumb(Window, s, psbi, pSBData);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue