Commit c00ded58 authored by Ge van Geldorp's avatar Ge van Geldorp Committed by Alexandre Julliard

Do some bounds checking on iOrder.

parent f9b3edb4
......@@ -930,6 +930,10 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
nItem = infoPtr->uNumItem;
iOrder = (phdi->mask & HDI_ORDER) ? phdi->iOrder : nItem;
if (iOrder < 0)
iOrder = 0;
else if (infoPtr->uNumItem < iOrder)
iOrder = infoPtr->uNumItem;
if (infoPtr->uNumItem == 0) {
infoPtr->items = Alloc (sizeof (HEADER_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