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

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


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

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

riched20: Handle range method failures in InRange (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 198061d..1cb6589 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -2006,10 +2006,11 @@ static HRESULT textrange_inrange(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