From a81756823140c56c29114061c18cd8faa6ea407b Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 13 Nov 2002 19:49:29 +0000 Subject: [PATCH] Fixed sign problem in GetWindowWord/Long check for offset larger than the window extra bytes. --- windows/win.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/windows/win.c b/windows/win.c index 649d071c15..e8897687b0 100644 --- a/windows/win.c +++ b/windows/win.c @@ -1771,7 +1771,7 @@ WORD WINAPI GetWindowWord( HWND hwnd, INT offset ) SetLastError( ERROR_INVALID_WINDOW_HANDLE ); return 0; } - if (offset > wndPtr->cbWndExtra - sizeof(WORD)) + if (offset > (int)(wndPtr->cbWndExtra - sizeof(WORD))) { WARN("Invalid offset %d\n", offset ); SetLastError( ERROR_INVALID_INDEX ); @@ -1837,7 +1837,7 @@ WORD WINAPI SetWindowWord( HWND hwnd, INT offset, WORD newval ) return 0; } - if (offset > wndPtr->cbWndExtra - sizeof(WORD)) + if (offset > (int)(wndPtr->cbWndExtra - sizeof(WORD))) { WARN("Invalid offset %d\n", offset ); WIN_ReleasePtr(wndPtr); @@ -1916,7 +1916,7 @@ static LONG WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type ) if (offset >= 0) { - if (offset > wndPtr->cbWndExtra - sizeof(LONG)) + if (offset > (int)(wndPtr->cbWndExtra - sizeof(LONG))) { /* * Some programs try to access last element from 16 bit @@ -2005,7 +2005,7 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval, if (offset >= 0) { LONG *ptr = (LONG *)(((char *)wndPtr->wExtra) + offset); - if (offset > wndPtr->cbWndExtra - sizeof(LONG)) + if (offset > (int)(wndPtr->cbWndExtra - sizeof(LONG))) { WARN("Invalid offset %d\n", offset ); WIN_ReleasePtr( wndPtr ); -- 2.32.0.93.g670b81a890