Commit 6646c46e authored by Mehmet Yasar's avatar Mehmet Yasar Committed by Alexandre Julliard

Add more check inside SB_SETTEXT and SB_GETTEXT.

parent 52e0e9c1
...@@ -393,6 +393,8 @@ STATUSBAR_GetTextA (STATUSWINDOWINFO *infoPtr, INT nPart, LPSTR buf) ...@@ -393,6 +393,8 @@ STATUSBAR_GetTextA (STATUSWINDOWINFO *infoPtr, INT nPart, LPSTR buf)
LRESULT result; LRESULT result;
TRACE("part %d\n", nPart); TRACE("part %d\n", nPart);
if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
if (infoPtr->simple) if (infoPtr->simple)
part = &infoPtr->part0; part = &infoPtr->part0;
else else
...@@ -418,6 +420,8 @@ STATUSBAR_GetTextW (STATUSWINDOWINFO *infoPtr, INT nPart, LPWSTR buf) ...@@ -418,6 +420,8 @@ STATUSBAR_GetTextW (STATUSWINDOWINFO *infoPtr, INT nPart, LPWSTR buf)
LRESULT result; LRESULT result;
TRACE("part %d\n", nPart); TRACE("part %d\n", nPart);
if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
if (infoPtr->simple) if (infoPtr->simple)
part = &infoPtr->part0; part = &infoPtr->part0;
else else
...@@ -573,9 +577,6 @@ STATUSBAR_SetParts (STATUSWINDOWINFO *infoPtr, INT count, LPINT parts) ...@@ -573,9 +577,6 @@ STATUSBAR_SetParts (STATUSWINDOWINFO *infoPtr, INT count, LPINT parts)
TRACE("(%d,%p)\n", count, parts); TRACE("(%d,%p)\n", count, parts);
if (infoPtr->simple)
infoPtr->simple = FALSE;
oldNumParts = infoPtr->numParts; oldNumParts = infoPtr->numParts;
infoPtr->numParts = count; infoPtr->numParts = count;
if (oldNumParts > infoPtr->numParts) { if (oldNumParts > infoPtr->numParts) {
...@@ -646,6 +647,7 @@ STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style, ...@@ -646,6 +647,7 @@ STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style,
BOOL changed = FALSE; BOOL changed = FALSE;
TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW)); TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW));
if (nPart < 0 || nPart >= infoPtr->numParts) return FALSE;
if (nPart == 0x00ff) if (nPart == 0x00ff)
part = &infoPtr->part0; part = &infoPtr->part0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment