richedit: Avoid crashing if TxSendMessage is called with NULL plresult.

Dylan Smith dylan.ah.smith at gmail.com
Thu Feb 26 02:43:14 CST 2009


I tried running MSN Messenger 7.0, and found that it was passing NULL
pointer for plresult, which caused wine to crash when it tried to
dereference the NULL pointer to set the value.
---
 dlls/riched20/txtsrv.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
-------------- next part --------------
diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c
index d7b915c..a6d8170 100644
--- a/dlls/riched20/txtsrv.c
+++ b/dlls/riched20/txtsrv.c
@@ -156,8 +156,10 @@ HRESULT WINAPI fnTextSrv_TxSendMessage(ITextServices *iface,
 {
    ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
    HRESULT hresult;
+   LRESULT lresult;
 
-   *plresult = ME_HandleMessage(This->editor, msg, wparam, lparam, TRUE, &hresult);
+   lresult = ME_HandleMessage(This->editor, msg, wparam, lparam, TRUE, &hresult);
+   if (plresult) *plresult = lresult;
    return hresult;
 }
 


More information about the wine-patches mailing list