Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ef01f6ac
Commit
ef01f6ac
authored
Jul 14, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use malloc() to allocate the buffer in unix_to_nt_file_name().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
314cd9cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
env.c
dlls/ntdll/unix/env.c
+2
-2
file.c
dlls/ntdll/unix/file.c
+4
-5
No files found.
dlls/ntdll/unix/env.c
View file @
ef01f6ac
...
...
@@ -1064,7 +1064,7 @@ static void add_path_var( WCHAR *env, SIZE_T *pos, const char *name, const char
{
if
(
unix_to_nt_file_name
(
path
,
&
nt_name
))
return
;
append_envW
(
env
,
pos
,
name
,
nt_name
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
nt_name
);
free
(
nt_name
);
}
}
...
...
@@ -1217,7 +1217,7 @@ void CDECL get_initial_directory( UNICODE_STRING *dir )
memcpy
(
dir
->
Buffer
,
nt_name
,
dir
->
Length
);
dir
->
Buffer
[
1
]
=
'\\'
;
}
RtlFreeHeap
(
GetProcessHeap
(),
0
,
nt_name
);
free
(
nt_name
);
}
}
...
...
dlls/ntdll/unix/file.c
View file @
ef01f6ac
...
...
@@ -1834,7 +1834,7 @@ static NTSTATUS fill_name_info( const char *unix_name, FILE_NAME_INFORMATION *in
else
*
name_len
=
info
->
FileNameLength
;
memcpy
(
info
->
FileName
,
ptr
,
*
name_len
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
nt_name
);
free
(
nt_name
);
}
return
status
;
...
...
@@ -3447,8 +3447,7 @@ NTSTATUS unix_to_nt_file_name( const char *name, WCHAR **nt )
else
if
(
status
!=
STATUS_OBJECT_PATH_NOT_FOUND
)
return
status
;
lenW
=
wcslen
(
prefix
);
if
(
!
(
buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
(
lenA
+
lenW
+
1
)
*
sizeof
(
WCHAR
)
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
buffer
=
malloc
(
(
lenA
+
lenW
+
1
)
*
sizeof
(
WCHAR
)
)))
return
STATUS_NO_MEMORY
;
memcpy
(
buffer
,
prefix
,
lenW
*
sizeof
(
WCHAR
)
);
lenW
+=
ntdll_umbstowcs
(
path
,
lenA
,
buffer
+
lenW
,
lenA
);
buffer
[
lenW
]
=
0
;
...
...
@@ -3474,7 +3473,7 @@ NTSTATUS CDECL wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, SIZE_
if
(
*
size
>
wcslen
(
nt_name
))
wcscpy
(
buffer
,
nt_name
);
else
status
=
STATUS_BUFFER_TOO_SMALL
;
*
size
=
wcslen
(
nt_name
)
+
1
;
RtlFreeHeap
(
GetProcessHeap
(),
0
,
nt_name
);
free
(
nt_name
);
}
return
status
;
}
...
...
@@ -6411,7 +6410,7 @@ NTSTATUS WINAPI NtQueryObject( HANDLE handle, OBJECT_INFORMATION_CLASS info_clas
wcscpy
(
p
->
Name
.
Buffer
,
nt_name
);
}
if
(
used_len
)
*
used_len
=
sizeof
(
*
p
)
+
size
;
RtlFreeHeap
(
GetProcessHeap
(),
0
,
nt_name
);
free
(
nt_name
);
}
RtlFreeHeap
(
GetProcessHeap
(),
0
,
unix_name
);
break
;
...
...
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