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
173ffe50
Commit
173ffe50
authored
May 16, 2022
by
Fabian Maurer
Committed by
Alexandre Julliard
Oct 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Prevent double free (Coverity).
The fd gets overwritten, therefore we need to close it before doing so. Signed-off-by:
Fabian Maurer
<
dark.shadow4@web.de
>
parent
c7b8da64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
file.c
dlls/ntdll/unix/file.c
+1
-1
No files found.
dlls/ntdll/unix/file.c
View file @
173ffe50
...
@@ -4417,12 +4417,12 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
...
@@ -4417,12 +4417,12 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
if
(
size
>
0x10000
)
size
=
0x10000
;
if
(
size
>
0x10000
)
size
=
0x10000
;
if
((
tmpbuf
=
malloc
(
size
)))
if
((
tmpbuf
=
malloc
(
size
)))
{
{
if
(
needs_close
)
close
(
fd
);
if
(
!
server_get_unix_fd
(
handle
,
FILE_READ_DATA
,
&
fd
,
&
needs_close
,
NULL
,
NULL
))
if
(
!
server_get_unix_fd
(
handle
,
FILE_READ_DATA
,
&
fd
,
&
needs_close
,
NULL
,
NULL
))
{
{
int
res
=
recv
(
fd
,
tmpbuf
,
size
,
MSG_PEEK
);
int
res
=
recv
(
fd
,
tmpbuf
,
size
,
MSG_PEEK
);
info
->
MessagesAvailable
=
(
res
>
0
);
info
->
MessagesAvailable
=
(
res
>
0
);
info
->
NextMessageSize
=
(
res
>=
0
)
?
res
:
MAILSLOT_NO_MESSAGE
;
info
->
NextMessageSize
=
(
res
>=
0
)
?
res
:
MAILSLOT_NO_MESSAGE
;
if
(
needs_close
)
close
(
fd
);
}
}
free
(
tmpbuf
);
free
(
tmpbuf
);
}
}
...
...
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