Fixed that !WriteKeyValue fails if filepath includes ".." like "skin..ini".

This commit is contained in:
spx 2011-09-09 17:15:02 +00:00
parent f14d751604
commit 58a16ef66e
2 changed files with 2 additions and 2 deletions

View File

@ -851,5 +851,5 @@ CMeasure* CMeasure::Create(const WCHAR* measure, CMeterWindow* meterWindow, cons
*/
void CMeasure::ExecuteBang(const WCHAR* args)
{
LogWithArgs(LOG_WARNING, L"!CommandMeasure: Not suppoted by [%s]", m_Name.c_str());
LogWithArgs(LOG_WARNING, L"!CommandMeasure: Not supported by [%s]", m_Name.c_str());
}

View File

@ -1557,7 +1557,7 @@ void RainmeterWriteKeyValueWide(const WCHAR* arg)
{
const std::wstring& iniFile = subStrings[3];
if (iniFile.find(L"..") != std::string::npos)
if (iniFile.find(L"..\\") != std::string::npos || iniFile.find(L"../") != std::string::npos)
{
LogWithArgs(LOG_ERROR, L"!WriteKeyValue: Illegal path: %s", iniFile.c_str());
return;