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
5bd7e306
Commit
5bd7e306
authored
Mar 08, 2009
by
Jim Cameron
Committed by
Alexandre Julliard
Mar 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Fix crash importing large values from Unicode.
parent
5ccf92f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
regproc.c
programs/regedit/regproc.c
+19
-9
No files found.
programs/regedit/regproc.c
View file @
5bd7e306
...
@@ -732,12 +732,14 @@ static void processRegLinesW(FILE *in)
...
@@ -732,12 +732,14 @@ static void processRegLinesW(FILE *in)
ULONG
lineSize
=
REG_VAL_BUF_SIZE
;
ULONG
lineSize
=
REG_VAL_BUF_SIZE
;
size_t
CharsInBuf
=
-
1
;
size_t
CharsInBuf
=
-
1
;
WCHAR
*
s
;
/* The pointer into line for where the current fgets should read */
WCHAR
*
s
;
/* The pointer into buf for where the current fgets should read */
WCHAR
*
line
;
/* The start of the current line */
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lineSize
*
sizeof
(
WCHAR
));
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lineSize
*
sizeof
(
WCHAR
));
CHECK_ENOUGH_MEMORY
(
buf
);
CHECK_ENOUGH_MEMORY
(
buf
);
s
=
buf
;
s
=
buf
;
line
=
buf
;
while
(
!
feof
(
in
))
{
while
(
!
feof
(
in
))
{
size_t
size_remaining
;
size_t
size_remaining
;
...
@@ -757,6 +759,7 @@ static void processRegLinesW(FILE *in)
...
@@ -757,6 +759,7 @@ static void processRegLinesW(FILE *in)
new_buffer
=
NULL
;
new_buffer
=
NULL
;
CHECK_ENOUGH_MEMORY
(
new_buffer
);
CHECK_ENOUGH_MEMORY
(
new_buffer
);
buf
=
new_buffer
;
buf
=
new_buffer
;
line
=
buf
;
s
=
buf
+
lineSize
-
size_remaining
;
s
=
buf
+
lineSize
-
size_remaining
;
lineSize
=
new_size
;
lineSize
=
new_size
;
size_remaining
=
lineSize
-
(
s
-
buf
);
size_remaining
=
lineSize
-
(
s
-
buf
);
...
@@ -787,14 +790,21 @@ static void processRegLinesW(FILE *in)
...
@@ -787,14 +790,21 @@ static void processRegLinesW(FILE *in)
/* If we didn't read the eol nor the eof go around for the rest */
/* If we didn't read the eol nor the eof go around for the rest */
while
(
1
)
while
(
1
)
{
{
s_eol
=
strchrW
(
s
,
'\n'
);
s_eol
=
strchrW
(
line
,
'\n'
);
if
(
!
s_eol
)
if
(
!
s_eol
)
{
/* Move the stub of the line to the start of the buffer so
* we get the maximum space to read into, and so we don't
* have to recalculate 'line' if the buffer expands */
MoveMemory
(
buf
,
line
,
(
strlenW
(
line
)
+
1
)
*
sizeof
(
WCHAR
));
line
=
buf
;
s
=
strchrW
(
line
,
'\0'
);
break
;
break
;
}
/* If it is a comment line then discard it and go around again */
/* If it is a comment line then discard it and go around again */
if
(
*
s
==
'#'
)
{
if
(
*
line
==
'#'
)
{
s
=
s_eol
+
1
;
line
=
s_eol
+
1
;
continue
;
continue
;
}
}
...
@@ -811,7 +821,7 @@ static void processRegLinesW(FILE *in)
...
@@ -811,7 +821,7 @@ static void processRegLinesW(FILE *in)
if
(
*
(
s_eol
-
1
)
==
'\r'
)
if
(
*
(
s_eol
-
1
)
==
'\r'
)
s_eol
--
;
s_eol
--
;
MoveMemory
(
s_eol
-
1
,
NextLine
,
(
CharsInBuf
-
(
NextLine
-
buf
)
+
1
)
*
sizeof
(
WCHAR
));
MoveMemory
(
s_eol
-
1
,
NextLine
,
(
CharsInBuf
-
(
NextLine
-
s
)
+
1
)
*
sizeof
(
WCHAR
));
CharsInBuf
-=
NextLine
-
s_eol
+
1
;
CharsInBuf
-=
NextLine
-
s_eol
+
1
;
s_eol
=
0
;
s_eol
=
0
;
continue
;
continue
;
...
@@ -827,8 +837,8 @@ static void processRegLinesW(FILE *in)
...
@@ -827,8 +837,8 @@ static void processRegLinesW(FILE *in)
if
(
!
s_eol
)
if
(
!
s_eol
)
break
;
break
;
processRegEntry
(
s
,
TRUE
);
processRegEntry
(
line
,
TRUE
);
s
=
s_eol
+
1
;
line
=
s_eol
+
1
;
s_eol
=
0
;
s_eol
=
0
;
continue
;
/* That is the full virtual line */
continue
;
/* That is the full virtual line */
}
}
...
...
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