Nikolay Sivov : dwrite: Protect from space-only strings when trimming away spaces.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Aug 19 09:56:01 CDT 2015


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Aug 18 23:49:50 2015 +0300

dwrite: Protect from space-only strings when trimming away spaces.

---

 dlls/dwrite/font.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 7e88a2f..a0596ea 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -1967,7 +1967,10 @@ static int trim_spaces(WCHAR *in, WCHAR *ret)
     while (isspaceW(*in))
         in++;
 
-    len = strlenW(in);
+    ret[0] = 0;
+    if (!(len = strlenW(in)))
+        return 0;
+
     while (isspaceW(in[len-1]))
         len--;
 




More information about the wine-cvs mailing list