x11drv: ime: In the update functions if we get a null string with a len report this and fix len to be 0 (Coverity 656 and 655).

oldstable
Aric Stewart 2008-10-02 10:43:13 -05:00 committed by Alexandre Julliard
parent ea08576820
commit 6d652ddc4f
1 changed files with 12 additions and 0 deletions

View File

@ -207,6 +207,12 @@ static HIMCC updateCompStr(HIMCC old, LPWSTR compstr, DWORD len)
if (old == NULL && compstr == NULL && len == 0)
return NULL;
if (compstr == NULL && len != 0)
{
ERR("compstr is NULL however we have a len! Please report\n");
len = 0;
}
if (old != NULL)
{
olddata = ImmLockIMCC(old);
@ -343,6 +349,12 @@ static HIMCC updateResultStr(HIMCC old, LPWSTR resultstr, DWORD len)
if (old == NULL && resultstr == NULL && len == 0)
return NULL;
if (resultstr == NULL && len != 0)
{
ERR("resultstr is NULL however we have a len! Please report\n");
len = 0;
}
if (old != NULL)
{
olddata = ImmLockIMCC(old);