Jinoh Kang : comctl32: Fix integer overflow in DPA_Search.

Alexandre Julliard julliard at winehq.org
Fri Jun 10 16:28:25 CDT 2022


Module: wine
Branch: master
Commit: 58571710ba7421bc2fee5c912157d16a90a1c7b5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=58571710ba7421bc2fee5c912157d16a90a1c7b5

Author: Jinoh Kang <jinoh.kang.kr at gmail.com>
Date:   Sat Mar 12 20:54:29 2022 +0900

comctl32: Fix integer overflow in DPA_Search.

Signed-off-by: Jinoh Kang <jinoh.kang.kr at gmail.com>

---

 dlls/comctl32/dpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/comctl32/dpa.c b/dlls/comctl32/dpa.c
index b8d23f6cafa..aa9a045e516 100644
--- a/dlls/comctl32/dpa.c
+++ b/dlls/comctl32/dpa.c
@@ -859,7 +859,7 @@ INT WINAPI DPA_Search (HDPA hdpa, LPVOID pFind, INT nStart,
         r = hdpa->nItemCount - 1;
         lpPtr = hdpa->ptrs;
         while (r >= l) {
-            x = (l + r) / 2;
+            x = l + (r - l) / 2;
             n = (pfnCompare)(pFind, lpPtr[x], lParam);
             if (n == 0)
                 return x;




More information about the wine-cvs mailing list