Marcus Meissner : comctl32: Avoid potential overflow in Search Param ( Coverity 903).

Alexandre Julliard julliard at winehq.org
Mon Apr 6 09:00:32 CDT 2009


Module: wine
Branch: master
Commit: e28c28b461af64d2a3d3e16a5d85785a5ee36518
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e28c28b461af64d2a3d3e16a5d85785a5ee36518

Author: Marcus Meissner <marcus at 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;




More information about the wine-cvs mailing list