Commit 8af406fb authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

winefile: Check index before buffer overread (Coverity).

parent 0a8df5ef
......@@ -3163,7 +3163,7 @@ static void set_header(Pane* pane)
item.mask = HDI_WIDTH;
item.cxy = 0;
for(; x+pane->widths[i]<scroll_pos && i<COLUMNS; i++) {
for(; (i < COLUMNS) && (x+pane->widths[i] < scroll_pos); i++) {
x += pane->widths[i];
SendMessageW(pane->hwndHeader, HDM_SETITEMW, i, (LPARAM)&item);
}
......@@ -3173,7 +3173,7 @@ static void set_header(Pane* pane)
item.cxy = x - scroll_pos;
SendMessageW(pane->hwndHeader, HDM_SETITEMW, i++, (LPARAM)&item);
for(; i<COLUMNS; i++) {
for(; i < COLUMNS; i++) {
item.cxy = pane->widths[i];
x += pane->widths[i];
SendMessageW(pane->hwndHeader, HDM_SETITEMW, i, (LPARAM)&item);
......
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