mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 15:20:47 +00:00
winefile: Check index before buffer overread (Coverity).
This commit is contained in:
parent
0a8df5ef26
commit
8af406fb00
|
@ -3163,7 +3163,7 @@ static void set_header(Pane* pane)
|
||||||
item.mask = HDI_WIDTH;
|
item.mask = HDI_WIDTH;
|
||||||
item.cxy = 0;
|
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];
|
x += pane->widths[i];
|
||||||
SendMessageW(pane->hwndHeader, HDM_SETITEMW, i, (LPARAM)&item);
|
SendMessageW(pane->hwndHeader, HDM_SETITEMW, i, (LPARAM)&item);
|
||||||
}
|
}
|
||||||
|
@ -3173,7 +3173,7 @@ static void set_header(Pane* pane)
|
||||||
item.cxy = x - scroll_pos;
|
item.cxy = x - scroll_pos;
|
||||||
SendMessageW(pane->hwndHeader, HDM_SETITEMW, i++, (LPARAM)&item);
|
SendMessageW(pane->hwndHeader, HDM_SETITEMW, i++, (LPARAM)&item);
|
||||||
|
|
||||||
for(; i<COLUMNS; i++) {
|
for(; i < COLUMNS; i++) {
|
||||||
item.cxy = pane->widths[i];
|
item.cxy = pane->widths[i];
|
||||||
x += pane->widths[i];
|
x += pane->widths[i];
|
||||||
SendMessageW(pane->hwndHeader, HDM_SETITEMW, i, (LPARAM)&item);
|
SendMessageW(pane->hwndHeader, HDM_SETITEMW, i, (LPARAM)&item);
|
||||||
|
|
Loading…
Reference in a new issue