Nikolay Sivov : riched20: Handle range method failures in IsEqual ( Coverity).

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 8 07:49:55 CDT 2015


Module: wine
Branch: master
Commit: 3889dadcca1c5a0638168a3750cf566bb9d26543
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3889dadcca1c5a0638168a3750cf566bb9d26543

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sun Jun  7 23:26:50 2015 +0300

riched20: Handle range method failures in IsEqual (Coverity).

---

 dlls/riched20/richole.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index b7f0298..198061d 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -2048,10 +2048,11 @@ static HRESULT textrange_isequal(LONG start, LONG end, ITextRange *range, LONG *
     if (!ret)
         ret = &v;
 
-    ITextRange_GetStart(range, &from);
-    ITextRange_GetEnd(range, &to);
-
-    *ret = (start == from && end == to) ? tomTrue : tomFalse;
+    if (FAILED(ITextRange_GetStart(range, &from)) || FAILED(ITextRange_GetEnd(range, &to))) {
+        *ret = tomFalse;
+    }
+    else
+        *ret = (start == from && end == to) ? tomTrue : tomFalse;
     return *ret == tomTrue ? S_OK : S_FALSE;
 }
 




More information about the wine-cvs mailing list