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
088a3372
Commit
088a3372
authored
Mar 01, 2008
by
Marcus Meissner
Committed by
Alexandre Julliard
Mar 03, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Handle buffer overflow on A->W converter.
parent
dd997c1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
path.c
dlls/shlwapi/path.c
+6
-1
path.c
dlls/shlwapi/tests/path.c
+1
-1
No files found.
dlls/shlwapi/path.c
View file @
088a3372
...
...
@@ -2344,7 +2344,12 @@ BOOL WINAPI PathCanonicalizeA(LPSTR lpszBuf, LPCSTR lpszPath)
{
WCHAR
szPath
[
MAX_PATH
];
WCHAR
szBuff
[
MAX_PATH
];
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszPath
,
-
1
,
szPath
,
MAX_PATH
);
int
ret
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszPath
,
-
1
,
szPath
,
MAX_PATH
);
if
(
!
ret
)
{
WARN
(
"Failed to convert string to widechar (too long?), LE %d.
\n
"
,
GetLastError
());
return
FALSE
;
}
bRet
=
PathCanonicalizeW
(
szBuff
,
szPath
);
WideCharToMultiByte
(
CP_ACP
,
0
,
szBuff
,
-
1
,
lpszBuf
,
MAX_PATH
,
0
,
0
);
}
...
...
dlls/shlwapi/tests/path.c
View file @
088a3372
...
...
@@ -908,9 +908,9 @@ static void test_PathCanonicalizeA(void)
lstrcpy
(
dest
,
"test"
);
SetLastError
(
0xdeadbeef
);
res
=
PathCanonicalizeA
(
dest
,
too_long
);
ok
(
!
res
,
"Expected failure
\n
"
);
todo_wine
{
ok
(
!
res
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
}
ok
(
lstrlen
(
too_long
)
==
LONG_LEN
-
1
,
"Expected length LONG_LEN - 1, got %i
\n
"
,
lstrlen
(
too_long
));
...
...
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