Module: wine Branch: master Commit: e28c28b461af64d2a3d3e16a5d85785a5ee36518 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e28c28b461af64d2a3d3e16a5d...
Author: Marcus Meissner marcus@jet.franken.de Date: Sat Apr 4 17:57:09 2009 +0200
comctl32: Avoid potential overflow in Search Param (Coverity 903).
---
dlls/comctl32/listview.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index caf82b9..9d1b4ff 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -1547,7 +1547,7 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L /* update the search parameters */ infoPtr->lastKeyPressTimestamp = GetTickCount(); if (infoPtr->lastKeyPressTimestamp - lastKeyPressTimestamp < KEY_DELAY) { - if (infoPtr->nSearchParamLength < MAX_PATH) + if (infoPtr->nSearchParamLength < MAX_PATH-1) infoPtr->szSearchParam[infoPtr->nSearchParamLength++]=charCode; if (infoPtr->charCode != charCode) infoPtr->charCode = charCode = 0;