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
89b9af77
Commit
89b9af77
authored
Nov 11, 2007
by
Dan Kegel
Committed by
Alexandre Julliard
Nov 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Fix buffer overrun in tests/registry.c:wine_debugstr_wn().
parent
6c8ed9ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
registry.c
dlls/advapi32/tests/registry.c
+4
-5
No files found.
dlls/advapi32/tests/registry.c
View file @
89b9af77
...
...
@@ -56,7 +56,6 @@ static char *get_temp_buffer( int size )
return
ret
;
}
/* default implementation of wine_dbgstr_an */
static
const
char
*
wine_debugstr_an
(
const
char
*
str
,
int
n
)
{
static
const
char
hex
[
16
]
=
"0123456789abcdef"
;
...
...
@@ -108,10 +107,10 @@ static const char *wine_debugstr_an( const char *str, int n )
return
res
;
}
/* default implementation of wine_dbgstr_wn */
static
const
char
*
wine_debugstr_wn
(
const
WCHAR
*
str
,
int
n
)
{
char
*
dst
,
*
res
;
size_t
size
;
if
(
!
HIWORD
(
str
))
{
...
...
@@ -122,11 +121,11 @@ static const char *wine_debugstr_wn( const WCHAR *str, int n )
}
if
(
n
==
-
1
)
n
=
lstrlenW
(
str
);
if
(
n
<
0
)
n
=
0
;
else
if
(
n
>
200
)
n
=
200
;
size
=
12
+
min
(
300
,
n
*
5
)
;
dst
=
res
=
get_temp_buffer
(
n
*
5
+
7
);
*
dst
++
=
'L'
;
*
dst
++
=
'"'
;
while
(
n
--
>
0
)
while
(
n
--
>
0
&&
dst
<=
res
+
size
-
10
)
{
WCHAR
c
=
*
str
++
;
switch
(
c
)
...
...
@@ -148,7 +147,7 @@ static const char *wine_debugstr_wn( const WCHAR *str, int n )
}
}
*
dst
++
=
'"'
;
if
(
*
str
)
if
(
n
>
0
)
{
*
dst
++
=
'.'
;
*
dst
++
=
'.'
;
...
...
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