[EXPLORER]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 12 Mar 2011 08:23:05 +0000 (08:23 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 12 Mar 2011 08:23:05 +0000 (08:23 +0000)
Fix array access out of bounds.
See issue #5990 for more details

svn path=/trunk/; revision=51022

reactos/base/shell/explorer/shell/pane.cpp

index b5fd6ab..1e69b60 100644 (file)
@@ -702,7 +702,7 @@ void Pane::set_header()
        item.mask = HDI_WIDTH;
        item.cxy = 0;
 
        item.mask = HDI_WIDTH;
        item.cxy = 0;
 
-       for(; x+_widths[i]<scroll_pos && i<COLUMNS; i++) {
+       for(; i<COLUMNS && x+_widths[i]<scroll_pos; i++) {
                x += _widths[i];
                Header_SetItem(_hwndHeader, i, &item);
        }
                x += _widths[i];
                Header_SetItem(_hwndHeader, i, &item);
        }