Module: wine Branch: master Commit: 1f54400bbf35de4f892468b78544951c3dc8f968 URL: http://source.winehq.org/git/wine.git/?a=commit;h=1f54400bbf35de4f892468b785...
Author: Nikolay Sivov nsivov@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--;