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
f0ec2a5c
Commit
f0ec2a5c
authored
Oct 27, 2008
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Oct 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shdocvw/tests: Use the correct size for memset.
parent
3f2047c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
shdocvw.c
dlls/shdocvw/tests/shdocvw.c
+11
-11
No files found.
dlls/shdocvw/tests/shdocvw.c
View file @
f0ec2a5c
...
...
@@ -63,13 +63,13 @@ static void test_URLSubRegQueryA(void)
return
;
}
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
2
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
/* called by inetcpl.cpl */
hr
=
pURLSubRegQueryA
(
regpath_iemain
,
default_page_url
,
REG_SZ
,
buffer
,
INTERNET_MAX_URL_LENGTH
,
-
1
);
ok
(
hr
==
E_FAIL
||
hr
==
S_OK
,
"got 0x%x (expected E_FAIL or S_OK)
\n
"
,
hr
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
2
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
/* called by inetcpl.cpl */
hr
=
pURLSubRegQueryA
(
regpath_iemain
,
start_page
,
REG_SZ
,
buffer
,
INTERNET_MAX_URL_LENGTH
,
-
1
);
...
...
@@ -78,7 +78,7 @@ static void test_URLSubRegQueryA(void)
ok
(
hr
==
S_OK
,
"got 0x%x and %d (expected S_OK)
\n
"
,
hr
,
len
);
/* test buffer length: just large enough */
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
2
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
hr
=
pURLSubRegQueryA
(
regpath_iemain
,
start_page
,
REG_SZ
,
buffer
,
len
+
1
,
-
1
);
used
=
lstrlenA
(
buffer
);
...
...
@@ -87,7 +87,7 @@ static void test_URLSubRegQueryA(void)
"got 0x%x and %d (expected S_OK and %d)
\n
"
,
hr
,
used
,
len
);
/* no space for terminating 0: result is truncated */
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
2
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
hr
=
pURLSubRegQueryA
(
regpath_iemain
,
start_page
,
REG_SZ
,
buffer
,
len
,
-
1
);
used
=
lstrlenA
(
buffer
);
...
...
@@ -96,7 +96,7 @@ static void test_URLSubRegQueryA(void)
/* no space for the complete result: truncate another char */
if
(
len
>
1
)
{
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
2
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
hr
=
pURLSubRegQueryA
(
regpath_iemain
,
start_page
,
REG_SZ
,
buffer
,
len
-
1
,
-
1
);
used
=
lstrlenA
(
buffer
);
...
...
@@ -105,7 +105,7 @@ static void test_URLSubRegQueryA(void)
}
/* only space for the terminating 0: function still succeded */
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
2
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
hr
=
pURLSubRegQueryA
(
regpath_iemain
,
start_page
,
REG_SZ
,
buffer
,
1
,
-
1
);
used
=
lstrlenA
(
buffer
);
...
...
@@ -113,7 +113,7 @@ static void test_URLSubRegQueryA(void)
"got 0x%x and %d (expected S_OK and 0)
\n
"
,
hr
,
used
);
/* size of buffer is 0, but the function still succeed */
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
2
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
hr
=
pURLSubRegQueryA
(
regpath_iemain
,
start_page
,
REG_SZ
,
buffer
,
0
,
-
1
);
used
=
lstrlenA
(
buffer
);
...
...
@@ -128,14 +128,14 @@ static void test_URLSubRegQueryA(void)
ok
(
hr
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
hr
);
/* this value does not exist */
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
2
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
hr
=
pURLSubRegQueryA
(
regpath_iemain
,
does_not_exist
,
REG_SZ
,
buffer
,
INTERNET_MAX_URL_LENGTH
,
-
1
);
/* random bytes are copied to the buffer */
ok
((
hr
==
E_FAIL
),
"got 0x%x (expected E_FAIL)
\n
"
,
hr
);
/* the third parameter is ignored. Is it really a type? (data is REG_SZ) */
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
2
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
hr
=
pURLSubRegQueryA
(
regpath_iemain
,
start_page
,
REG_DWORD
,
buffer
,
INTERNET_MAX_URL_LENGTH
,
-
1
);
used
=
lstrlenA
(
buffer
);
...
...
@@ -143,13 +143,13 @@ static void test_URLSubRegQueryA(void)
"got 0x%x and %d (expected S_OK and %d)
\n
"
,
hr
,
used
,
len
);
/* the function works for HKCU and HKLM */
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
2
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
hr
=
pURLSubRegQueryA
(
regpath_shellfolders
,
appdata
,
REG_SZ
,
buffer
,
INTERNET_MAX_URL_LENGTH
,
-
1
);
used
=
lstrlenA
(
buffer
);
ok
(
hr
==
S_OK
,
"got 0x%x and %d (expected S_OK)
\n
"
,
hr
,
used
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
2
);
memset
(
buffer
,
'#'
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
hr
=
pURLSubRegQueryA
(
regpath_shellfolders
,
common_appdata
,
REG_SZ
,
buffer
,
INTERNET_MAX_URL_LENGTH
,
-
1
);
used
=
lstrlenA
(
buffer
);
...
...
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