_Everything_GetSearchTextA implement error, cause a crash.

Found a bug in "Everything"? report it here
Post Reply
liulikui
Posts: 2
Joined: Thu Apr 07, 2022 8:52 am

_Everything_GetSearchTextA implement error, cause a crash.

Post by liulikui »

Hi guys:
I found a error in the everything sdk.

// get the search length
static void _Everything_GetSearchTextA(LPSTR buf)
{
DWORD len;

if (_Everything_Search)
{
len = _Everything_GetSearchLengthW();

if (_Everything_IsUnicodeSearch)
{
WideCharToMultiByte(CP_ACP,0,(LPCWSTR )_Everything_Search,-1,buf,len+1,0,0);

return;
}
else
{
CopyMemory(buf,_Everything_Search,len+1);

return;
}
}

*buf = 0;
}

Here, "len = _Everything_GetSearchLengthW();" should correct to "len = _Everything_GetSearchLengthA();"

If not, CopyMemory(buf,_Everything_Search,len+1); will use a wrong len value and cause heap corruption and then crash.
void
Developer
Posts: 16672
Joined: Fri Oct 16, 2009 11:31 pm

Re: _Everything_GetSearchTextA implement error, cause a crash.

Post by void »

Thank you very much for your bug report.

I have updated the SDK to fix this bug.

Everything-SDK.zip
liulikui
Posts: 2
Joined: Thu Apr 07, 2022 8:52 am

Re: _Everything_GetSearchTextA implement error, cause a crash.

Post by liulikui »

Thanks for your quick reply :D
Post Reply