Brendan Shanks : dinput: Fix crash in dump_DIEFFECT() when rglDirection is unexpectedly NULL.

Alexandre Julliard julliard at winehq.org
Fri Aug 7 10:42:30 CDT 2020


Module: wine
Branch: stable
Commit: 0ee6ca739ee6f6ea2777a861ed372dd5e26bd6e9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0ee6ca739ee6f6ea2777a861ed372dd5e26bd6e9

Author: Brendan Shanks <bshanks at codeweavers.com>
Date:   Tue Mar 24 17:13:36 2020 -0700

dinput: Fix crash in dump_DIEFFECT() when rglDirection is unexpectedly NULL.

Signed-off-by: Brendan Shanks <bshanks at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit f925becd4af104b196440442c50858ea88d3cf17)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

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

diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
index 01611b0e44..19dd9ad736 100644
--- a/dlls/dinput/joystick.c
+++ b/dlls/dinput/joystick.c
@@ -207,7 +207,7 @@ void dump_DIEFFECT(LPCDIEFFECT eff, REFGUID guid, DWORD dwFlags)
     TRACE("  - dwTriggerButton: %d\n", eff->dwTriggerButton);
     TRACE("  - dwTriggerRepeatInterval: %d\n", eff->dwTriggerRepeatInterval);
     TRACE("  - rglDirection: %p\n", eff->rglDirection);
-    if (dwFlags & DIEP_DIRECTION) {
+    if (dwFlags & DIEP_DIRECTION && eff->rglDirection) {
         TRACE("    ");
         for (i = 0; i < eff->cAxes; ++i)
             TRACE("%d ", eff->rglDirection[i]);




More information about the wine-cvs mailing list