Gabriel Ivăncescu : vbscript: Fail if we have no context in InvokeEx.

Alexandre Julliard julliard at winehq.org
Thu Feb 13 15:36:32 CST 2020


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

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Thu Feb 13 19:49:52 2020 +0100

vbscript: Fail if we have no context in InvokeEx.

The current code can't cope with it, so do the same thing as in GetDispID,
to prevent a possible crash.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/vbscript/vbdisp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c
index c14cd7b4c7..36eba21e27 100644
--- a/dlls/vbscript/vbdisp.c
+++ b/dlls/vbscript/vbdisp.c
@@ -1388,6 +1388,9 @@ static HRESULT WINAPI ScriptDisp_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
 
     TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
 
+    if (!This->ctx)
+        return E_UNEXPECTED;
+
     if (id & DISPID_FUNCTION_MASK)
     {
         id &= ~DISPID_FUNCTION_MASK;




More information about the wine-cvs mailing list