mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 15:20:47 +00:00
comdlg32: Avoid crash when a path is passed into Open File Dialog.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0414332b08
commit
5809118892
|
@ -1565,10 +1565,16 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
|
||||||
result = GetFullPathNameW(fodInfos->filename, MAX_PATH, tmpBuf, &nameBit);
|
result = GetFullPathNameW(fodInfos->filename, MAX_PATH, tmpBuf, &nameBit);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|
||||||
/* nameBit is always shorter than the original filename */
|
/* nameBit is always shorter than the original filename. It may be NULL
|
||||||
|
* when the filename contains only a drive name instead of file name */
|
||||||
|
if (nameBit)
|
||||||
|
{
|
||||||
lstrcpyW(fodInfos->filename,nameBit);
|
lstrcpyW(fodInfos->filename,nameBit);
|
||||||
|
|
||||||
*nameBit = 0x00;
|
*nameBit = 0x00;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*fodInfos->filename = '\0';
|
||||||
|
|
||||||
MemFree(fodInfos->initdir);
|
MemFree(fodInfos->initdir);
|
||||||
fodInfos->initdir = MemAlloc((lstrlenW(tmpBuf) + 1)*sizeof(WCHAR));
|
fodInfos->initdir = MemAlloc((lstrlenW(tmpBuf) + 1)*sizeof(WCHAR));
|
||||||
lstrcpyW(fodInfos->initdir, tmpBuf);
|
lstrcpyW(fodInfos->initdir, tmpBuf);
|
||||||
|
|
Loading…
Reference in a new issue