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
be5d66f5
Commit
be5d66f5
authored
Jul 18, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jul 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
krnl386.exe: Fix a potential leak and NULL dereference in DPMI_xrealloc.
parent
ea7bcc6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
int31.c
dlls/krnl386.exe16/int31.c
+13
-7
No files found.
dlls/krnl386.exe16/int31.c
View file @
be5d66f5
...
...
@@ -263,21 +263,21 @@ static void DPMI_xfree( LPVOID ptr )
*
* FIXME: perhaps we could grow this mapped area...
*/
static
LPVOID
DPMI_xrealloc
(
LPVOID
ptr
,
DWORD
newsize
)
static
LPVOID
DPMI_xrealloc
(
LPVOID
ptr
,
DWORD
newsize
)
{
MEMORY_BASIC_INFORMATION
mbi
;
LPVOID
newptr
;
newptr
=
DPMI_xalloc
(
newsize
);
if
(
ptr
)
if
(
ptr
)
{
if
(
!
VirtualQuery
(
ptr
,
&
mbi
,
sizeof
(
mbi
)))
LPVOID
newptr
;
if
(
!
VirtualQuery
(
ptr
,
&
mbi
,
sizeof
(
mbi
)))
{
FIXME
(
"realloc of DPMI_xallocd region %p?
\n
"
,
ptr
);
return
NULL
;
}
if
(
mbi
.
State
==
MEM_FREE
)
if
(
mbi
.
State
==
MEM_FREE
)
{
FIXME
(
"realloc of DPMI_xallocd region %p?
\n
"
,
ptr
);
return
NULL
;
...
...
@@ -289,11 +289,17 @@ static LPVOID DPMI_xrealloc( LPVOID ptr, DWORD newsize )
if
(
newsize
<=
mbi
.
RegionSize
)
return
ptr
;
newptr
=
DPMI_xalloc
(
newsize
);
if
(
!
newptr
)
return
NULL
;
memcpy
(
newptr
,
ptr
,
mbi
.
RegionSize
);
DPMI_xfree
(
ptr
);
return
newptr
;
}
return
newptr
;
return
DPMI_xalloc
(
newsize
)
;
}
...
...
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