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
3af1e7df
Commit
3af1e7df
authored
Mar 11, 2024
by
Brendan Shanks
Committed by
Alexandre Julliard
Mar 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr: Replace some malloc/sprintf/strcpy calls with asprintf.
parent
a5b8e684
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
19 deletions
+9
-19
unixlib.c
dlls/mountmgr.sys/unixlib.c
+9
-19
No files found.
dlls/mountmgr.sys/unixlib.c
View file @
3af1e7df
...
@@ -89,22 +89,14 @@ static NTSTATUS errno_to_status( int err )
...
@@ -89,22 +89,14 @@ static NTSTATUS errno_to_status( int err )
static
char
*
get_dosdevices_path
(
const
char
*
dev
)
static
char
*
get_dosdevices_path
(
const
char
*
dev
)
{
{
const
char
*
home
=
getenv
(
"HOME"
);
const
char
*
prefix
=
getenv
(
"WINEPREFIX"
);
const
char
*
prefix
=
getenv
(
"WINEPREFIX"
);
size_t
len
=
(
prefix
?
strlen
(
prefix
)
:
strlen
(
home
)
+
strlen
(
"/.wine"
))
+
sizeof
(
"/dosdevices/"
)
+
strlen
(
dev
);
char
*
path
=
NULL
;
char
*
path
=
malloc
(
len
);
if
(
prefix
)
asprintf
(
&
path
,
"%s/dosdevices/%s"
,
prefix
,
dev
);
else
asprintf
(
&
path
,
"%s/.wine/dosdevices/%s"
,
getenv
(
"HOME"
),
dev
);
if
(
path
)
{
if
(
prefix
)
strcpy
(
path
,
prefix
);
else
{
strcpy
(
path
,
home
);
strcat
(
path
,
"/.wine"
);
}
strcat
(
path
,
"/dosdevices/"
);
strcat
(
path
,
dev
);
}
return
path
;
return
path
;
}
}
...
@@ -420,9 +412,9 @@ static NTSTATUS read_volume_file( void *args )
...
@@ -420,9 +412,9 @@ static NTSTATUS read_volume_file( void *args )
{
{
const
struct
read_volume_file_params
*
params
=
args
;
const
struct
read_volume_file_params
*
params
=
args
;
int
ret
,
fd
=
-
1
;
int
ret
,
fd
=
-
1
;
char
*
name
=
malloc
(
strlen
(
params
->
volume
)
+
strlen
(
params
->
file
)
+
2
)
;
char
*
name
=
NULL
;
sprintf
(
name
,
"%s/%s"
,
params
->
volume
,
params
->
file
);
asprintf
(
&
name
,
"%s/%s"
,
params
->
volume
,
params
->
file
);
if
(
name
[
0
]
!=
'/'
)
if
(
name
[
0
]
!=
'/'
)
{
{
...
@@ -508,9 +500,7 @@ static NTSTATUS set_shell_folder( void *args )
...
@@ -508,9 +500,7 @@ static NTSTATUS set_shell_folder( void *args )
if
(
link
&&
(
!
strcmp
(
link
,
"$HOME"
)
||
!
strncmp
(
link
,
"$HOME/"
,
6
))
&&
(
home
=
getenv
(
"HOME"
)))
if
(
link
&&
(
!
strcmp
(
link
,
"$HOME"
)
||
!
strncmp
(
link
,
"$HOME/"
,
6
))
&&
(
home
=
getenv
(
"HOME"
)))
{
{
link
+=
5
;
link
+=
5
;
homelink
=
malloc
(
strlen
(
home
)
+
strlen
(
link
)
+
1
);
asprintf
(
&
homelink
,
"%s%s"
,
home
,
link
);
strcpy
(
homelink
,
home
);
strcat
(
homelink
,
link
);
link
=
homelink
;
link
=
homelink
;
}
}
...
...
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