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
63557d57
Commit
63557d57
authored
Jun 10, 2008
by
Dan Kegel
Committed by
Alexandre Julliard
Jun 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Avoid buffer overflow during test.
parent
294fe6b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
shlfileop.c
dlls/shell32/tests/shlfileop.c
+22
-13
No files found.
dlls/shell32/tests/shlfileop.c
View file @
63557d57
...
...
@@ -843,8 +843,9 @@ static void test_copy(void)
createTestFile
(
"one.txt"
);
/* no double-NULL terminator for pFrom */
memset
(
from
,
'a'
,
MAX_PATH
);
/* pFrom contains bogus 2nd name longer than MAX_PATH */
memset
(
from
,
'a'
,
MAX_PATH
*
2
);
memset
(
from
+
MAX_PATH
*
2
,
0
,
2
);
lstrcpyA
(
from
,
"one.txt"
);
shfo
.
pFrom
=
from
;
shfo
.
pTo
=
"two.txt
\0
"
;
...
...
@@ -856,8 +857,9 @@ static void test_copy(void)
createTestFile
(
"one.txt"
);
/* no double-NULL terminator for pTo */
memset
(
to
,
'a'
,
MAX_PATH
);
/* pTo contains bogus 2nd name longer than MAX_PATH */
memset
(
to
,
'a'
,
MAX_PATH
*
2
);
memset
(
to
+
MAX_PATH
*
2
,
0
,
2
);
lstrcpyA
(
to
,
"two.txt"
);
shfo
.
pFrom
=
"one.txt
\0
"
;
shfo
.
pTo
=
to
;
...
...
@@ -880,9 +882,11 @@ static void test_copy(void)
createTestFile
(
"one.txt"
);
/* no double-NULL terminator for pFrom and pTo */
memset
(
from
,
'a'
,
MAX_PATH
);
memset
(
to
,
'a'
,
MAX_PATH
);
/* both pFrom and pTo contain bogus 2nd names longer than MAX_PATH */
memset
(
from
,
'a'
,
MAX_PATH
*
2
);
memset
(
from
+
MAX_PATH
*
2
,
0
,
2
);
memset
(
to
,
'a'
,
MAX_PATH
*
2
);
memset
(
to
+
MAX_PATH
*
2
,
0
,
2
);
lstrcpyA
(
from
,
"one.txt"
);
lstrcpyA
(
to
,
"two.txt"
);
shfo
.
pFrom
=
from
;
...
...
@@ -895,8 +899,9 @@ static void test_copy(void)
createTestFile
(
"one.txt"
);
/* no double-NULL terminator for pTo, FOF_MULTIDESTFILES */
memset
(
to
,
'a'
,
MAX_PATH
);
/* pTo contains bogus 2nd name longer than MAX_PATH, FOF_MULTIDESTFILES */
memset
(
to
,
'a'
,
MAX_PATH
*
2
);
memset
(
to
+
MAX_PATH
*
2
,
0
,
2
);
lstrcpyA
(
to
,
"two.txt"
);
shfo
.
pFrom
=
"one.txt
\0
"
;
shfo
.
pTo
=
to
;
...
...
@@ -910,11 +915,12 @@ static void test_copy(void)
createTestFile
(
"one.txt"
);
createTestFile
(
"two.txt"
);
/*
no double-NULL terminator for pTo
,
/*
pTo contains bogus 2nd name longer than MAX_PATH
,
* multiple source files,
* dest directory does not exist
*/
memset
(
to
,
'a'
,
2
*
MAX_PATH
);
memset
(
to
+
MAX_PATH
*
2
,
0
,
2
);
lstrcpyA
(
to
,
"threedir"
);
shfo
.
pFrom
=
"one.txt
\0
two.txt
\0
"
;
shfo
.
pTo
=
to
;
...
...
@@ -932,11 +938,12 @@ static void test_copy(void)
createTestFile
(
"two.txt"
);
CreateDirectoryA
(
"threedir"
,
NULL
);
/*
no double-NULL terminator for pTo
,
/*
pTo contains bogus 2nd name longer than MAX_PATH
,
* multiple source files,
* dest directory does exist
*/
memset
(
to
,
'a'
,
2
*
MAX_PATH
);
memset
(
to
+
MAX_PATH
*
2
,
0
,
2
);
lstrcpyA
(
to
,
"threedir"
);
shfo
.
pFrom
=
"one.txt
\0
two.txt
\0
"
;
shfo
.
pTo
=
to
;
...
...
@@ -952,11 +959,12 @@ static void test_copy(void)
createTestFile
(
"one.txt"
);
createTestFile
(
"two.txt"
);
/*
no double-NULL terminator for pTo
,
/*
pTo contains bogus 2nd name longer than MAX_PATH
,
* multiple source files, FOF_MULTIDESTFILES
* dest dir does not exist
*/
memset
(
to
,
'a'
,
2
*
MAX_PATH
);
memset
(
to
+
MAX_PATH
*
2
,
0
,
2
);
lstrcpyA
(
to
,
"threedir"
);
shfo
.
pFrom
=
"one.txt
\0
two.txt
\0
"
;
shfo
.
pTo
=
to
;
...
...
@@ -979,11 +987,12 @@ static void test_copy(void)
createTestFile
(
"two.txt"
);
CreateDirectoryA
(
"threedir"
,
NULL
);
/*
no double-NULL terminator for pTo
,
/*
pTo contains bogus 2nd name longer than MAX_PATH
,
* multiple source files, FOF_MULTIDESTFILES
* dest dir does exist
*/
memset
(
to
,
'a'
,
2
*
MAX_PATH
);
memset
(
to
+
MAX_PATH
*
2
,
0
,
2
);
lstrcpyA
(
to
,
"threedir"
);
ptr
=
to
+
lstrlenA
(
to
)
+
1
;
lstrcpyA
(
ptr
,
"fourdir"
);
...
...
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