Fixing bug 383769. nsLocalFile::EnsureShortPath should check if GetShortPathNameW failed. r=benjamin@smedbergs.us

This commit is contained in:
jwatt%jwatt.org 2007-06-27 08:36:03 +00:00
Родитель 9164ed181b
Коммит f76e322a62
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -2929,7 +2929,8 @@ nsLocalFile::EnsureShortPath()
WCHAR thisshort[MAX_PATH]; WCHAR thisshort[MAX_PATH];
DWORD thisr = ::GetShortPathNameW(mWorkingPath.get(), thisshort, DWORD thisr = ::GetShortPathNameW(mWorkingPath.get(), thisshort,
sizeof(thisshort)); sizeof(thisshort));
if (thisr < sizeof(thisshort)) // If an error occured (thisr == 0) thisshort is uninitialized memory!
if (thisr != 0 && thisr < sizeof(thisshort))
mShortWorkingPath.Assign(thisshort); mShortWorkingPath.Assign(thisshort);
else else
mShortWorkingPath.Assign(mWorkingPath); mShortWorkingPath.Assign(mWorkingPath);