[PATCH] comctl32: avoid potential overflow in Search Param (Coverity 903)
Marcus Meissner
marcus at jet.franken.de
Sat Apr 4 10:57:09 CDT 2009
Hi,
A single byte overflow could happen I guess.
Ciao, Marcus
---
dlls/comctl32/listview.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index caf82b9..9252be1 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -1582,6 +1582,8 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L
ZeroMemory(&lvfi, sizeof(lvfi));
lvfi.flags = (LVFI_WRAP | LVFI_PARTIAL);
+ if (infoPtr->nSearchParamLength >= MAX_PATH)
+ infoPtr->nSearchParamLength = MAX_PATH-1;
infoPtr->szSearchParam[infoPtr->nSearchParamLength] = '\0';
lvfi.psz = infoPtr->szSearchParam;
nmlv.iStart = idx;
--
1.5.6
More information about the wine-patches
mailing list