Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1e9acad3
Commit
1e9acad3
authored
Mar 25, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Fixed a number of buffer overflows in the file dialog.
parent
31666b31
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
filedlg.c
dlls/comdlg32/filedlg.c
+10
-13
No files found.
dlls/comdlg32/filedlg.c
View file @
1e9acad3
...
...
@@ -889,7 +889,7 @@ static INT_PTR FILEDLG95_Handle_GetFilePath(HWND hwnd, DWORD size, LPVOID buffer
{
/* 'n' includes trailing \0 */
bufW
[
n
-
1
]
=
'\\'
;
memcpy
(
&
bufW
[
n
],
lpstrFileList
,
(
size
-
n
)
*
sizeof
(
WCHAR
)
);
lstrcpynW
(
&
bufW
[
n
],
lpstrFileList
,
size
-
n
);
}
TRACE
(
"returned -> %s
\n
"
,
debugstr_wn
(
bufW
,
total
));
}
...
...
@@ -931,16 +931,15 @@ static INT_PTR FILEDLG95_Handle_GetFileSpec(HWND hwnd, DWORD size, LPVOID buffer
FILEDLG95_FILENAME_GetFileNames
(
hwnd
,
&
lpstrFileList
,
&
sizeUsed
,
' '
);
if
(
fodInfos
->
unicode
)
{
LPWSTR
bufW
=
buffer
;
memcpy
(
bufW
,
lpstrFileList
,
sizeof
(
WCHAR
)
*
sizeUsed
);
lstrcpynW
(
buffer
,
lpstrFileList
,
size
);
}
else
{
LPSTR
bufA
=
buffer
;
sizeUsed
=
WideCharToMultiByte
(
CP_ACP
,
0
,
lpstrFileList
,
sizeUsed
,
NULL
,
0
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpstrFileList
,
sizeUsed
,
bufA
,
size
,
NULL
,
NULL
)
;
DWORD
sizeA
=
WideCharToMultiByte
(
CP_ACP
,
0
,
lpstrFileList
,
sizeUsed
,
NULL
,
0
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpstrFileList
,
sizeUsed
,
bufA
,
size
,
NULL
,
NULL
);
if
(
size
&&
size
<
sizeA
)
bufA
[
size
-
1
]
=
0
;
sizeUsed
=
sizeA
;
}
MemFree
(
lpstrFileList
);
...
...
@@ -3237,29 +3236,27 @@ static int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPWSTR * lpstrFileList, U
while
((
lpstrEdit
[
nStrCharCount
]
!=
'"'
)
&&
(
nStrCharCount
<=
nStrLen
))
{
(
*
lpstrFileList
)[
nFileIndex
++
]
=
lpstrEdit
[
nStrCharCount
];
(
*
sizeUsed
)
++
;
nStrCharCount
++
;
}
(
*
lpstrFileList
)[
nFileIndex
++
]
=
separator
;
(
*
sizeUsed
)
++
;
nFileCount
++
;
}
nStrCharCount
++
;
}
/* single, unquoted string */
if
((
nStrLen
>
0
)
&&
(
*
sizeUsed
==
0
)
)
if
((
nStrLen
>
0
)
&&
(
nFileIndex
==
0
)
)
{
lstrcpyW
(
*
lpstrFileList
,
lpstrEdit
);
nFileIndex
=
lstrlenW
(
lpstrEdit
)
+
1
;
(
*
sizeUsed
)
=
nFileIndex
;
nFileCount
=
1
;
}
/* trailing \0 */
(
*
lpstrFileList
)[
nFileIndex
]
=
'\0'
;
(
*
sizeUsed
)
++
;
if
(
nFileIndex
&&
separator
)
nFileIndex
--
;
/* remove trailing separator */
(
*
lpstrFileList
)[
nFileIndex
++
]
=
'\0'
;
*
sizeUsed
=
nFileIndex
;
MemFree
(
lpstrEdit
);
return
nFileCount
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment