Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7de36f8e
Commit
7de36f8e
authored
Apr 29, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
May 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Skip too long paths.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
69f9480c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
builtins.c
programs/cmd/builtins.c
+21
-1
No files found.
programs/cmd/builtins.c
View file @
7de36f8e
...
...
@@ -1355,6 +1355,13 @@ static BOOL WCMD_delete_one (const WCHAR *thisArg) {
DIRECTORY_STACK
*
nextDir
;
WCHAR
subParm
[
MAX_PATH
];
if
(
wcslen
(
thisDir
)
+
wcslen
(
fd
.
cFileName
)
+
1
+
wcslen
(
fname
)
+
wcslen
(
ext
)
>=
MAX_PATH
)
{
WINE_TRACE
(
"Skipping path too long %s%s
\\
%s%s
\n
"
,
debugstr_w
(
thisDir
),
debugstr_w
(
fd
.
cFileName
),
debugstr_w
(
fname
),
debugstr_w
(
ext
));
continue
;
}
/* Work out search parameter in sub dir */
lstrcpyW
(
subParm
,
thisDir
);
lstrcatW
(
subParm
,
fd
.
cFileName
);
...
...
@@ -1761,7 +1768,14 @@ static void WCMD_add_dirstowalk(DIRECTORY_STACK *dirsToWalk) {
(
lstrcmpW
(
fd
.
cFileName
,
L".."
)
!=
0
)
&&
(
lstrcmpW
(
fd
.
cFileName
,
L"."
)
!=
0
))
{
/* Allocate memory, add to list */
DIRECTORY_STACK
*
toWalk
=
heap_xalloc
(
sizeof
(
DIRECTORY_STACK
));
DIRECTORY_STACK
*
toWalk
;
if
(
wcslen
(
dirsToWalk
->
dirName
)
+
1
+
wcslen
(
fd
.
cFileName
)
>=
MAX_PATH
)
{
WINE_TRACE
(
"Skipping too long path %s
\\
%s
\n
"
,
debugstr_w
(
dirsToWalk
->
dirName
),
debugstr_w
(
fd
.
cFileName
));
continue
;
}
toWalk
=
heap_xalloc
(
sizeof
(
DIRECTORY_STACK
));
WINE_TRACE
(
"(%p->%p)
\n
"
,
remainingDirs
,
remainingDirs
->
next
);
toWalk
->
next
=
remainingDirs
->
next
;
remainingDirs
->
next
=
toWalk
;
...
...
@@ -2321,6 +2335,12 @@ void WCMD_for (WCHAR *p, CMD_LIST **cmdList) {
WINE_TRACE
(
"Processing FOR filename %s
\n
"
,
wine_dbgstr_w
(
fd
.
cFileName
));
if
(
doRecurse
)
{
if
(
wcslen
(
dirsToWalk
->
dirName
)
+
1
+
wcslen
(
fd
.
cFileName
)
>=
MAX_PATH
)
{
WINE_TRACE
(
"Skipping too long path %s
\\
%s
\n
"
,
debugstr_w
(
dirsToWalk
->
dirName
),
debugstr_w
(
fd
.
cFileName
));
continue
;
}
lstrcpyW
(
fullitem
,
dirsToWalk
->
dirName
);
lstrcatW
(
fullitem
,
L"
\\
"
);
lstrcatW
(
fullitem
,
fd
.
cFileName
);
...
...
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