Huw Davies : msctf/tests: Don' t convert past the end of a nul terminated string.
Alexandre Julliard
julliard at winehq.org
Fri Nov 13 09:37:07 CST 2009
Module: wine
Branch: master
Commit: 625ec9f05f94329cd19bf28278248059b9ba372f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=625ec9f05f94329cd19bf28278248059b9ba372f
Author: Huw Davies <huw at codeweavers.com>
Date: Fri Nov 13 11:28:39 2009 +0000
msctf/tests: Don't convert past the end of a nul terminated string.
Found by Valgrind.
---
dlls/msctf/tests/inputprocessor.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c
index f4f737f..c445b41 100644
--- a/dlls/msctf/tests/inputprocessor.c
+++ b/dlls/msctf/tests/inputprocessor.c
@@ -1850,8 +1850,8 @@ static void enum_compartments(ITfCompartmentMgr *cmpmgr, REFGUID present, REFGUI
{
WCHAR str[50];
CHAR strA[50];
- StringFromGUID2(&g,str,50);
- WideCharToMultiByte(CP_ACP,0,str,50,strA,50,0,0);
+ StringFromGUID2(&g,str,sizeof(str)/sizeof(str[0]));
+ WideCharToMultiByte(CP_ACP,0,str,-1,strA,sizeof(strA),0,0);
trace("found %s\n",strA);
if (present && IsEqualGUID(present,&g))
found = TRUE;
More information about the wine-cvs
mailing list