Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
ed3e4d07
Commit
ed3e4d07
authored
Mar 24, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed 2 segfaults in config_OpenConfigFile.
parent
cbc66ff6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
src/misc/configuration.c
src/misc/configuration.c
+20
-19
No files found.
src/misc/configuration.c
View file @
ed3e4d07
...
@@ -755,38 +755,39 @@ void __config_ResetAll( vlc_object_t *p_this )
...
@@ -755,38 +755,39 @@ void __config_ResetAll( vlc_object_t *p_this )
}
}
static
FILE
*
config_OpenConfigFile
(
vlc_object_t
*
obj
,
const
char
*
mode
)
static
FILE
*
config_OpenConfigFile
(
vlc_object_t
*
p_obj
,
const
char
*
mode
)
{
{
static
const
char
subpath
[]
=
DIR_SEP
CONFIG_DIR
DIR_SEP
CONFIG_FILE
;
static
const
char
psz_subpath
[]
=
DIR_SEP
CONFIG_DIR
DIR_SEP
CONFIG_FILE
;
const
char
*
filename
=
obj
->
p_libvlc
->
psz_configfile
;
const
char
*
psz_filename
=
p_obj
->
p_libvlc
->
psz_configfile
;
const
char
*
homedir
;
const
char
*
psz_homedir
;
size_t
buflen
=
0
;
size_t
i_buflen
=
0
;
FILE
*
p_stream
;
if
(
filename
==
NULL
)
if
(
psz_filename
==
NULL
)
{
{
homedir
=
obj
->
p_libvlc
->
psz_homedir
;
psz_homedir
=
p_
obj
->
p_libvlc
->
psz_homedir
;
if
(
homedir
==
NULL
)
if
(
psz_homedir
==
NULL
)
{
{
msg_Err
(
obj
,
"no home directory defined"
);
msg_Err
(
p_obj
,
"no home directory defined"
);
return
NULL
;
return
NULL
;
}
}
buflen
=
strlen
(
homedir
)
+
sizeof
(
subpath
)
;
i_buflen
=
strlen
(
psz_homedir
)
+
sizeof
(
psz_subpath
)
+
1
;
}
}
char
buf
[
buflen
];
char
buf
[
i_
buflen
];
if
(
filename
==
NULL
)
if
(
psz_filename
==
NULL
)
{
{
sprintf
(
buf
,
"%s%s"
,
homedir
,
subpath
);
sprintf
(
buf
,
"%s%s"
,
psz_homedir
,
psz_subpath
);
filename
=
buf
;
psz_
filename
=
buf
;
}
}
msg_Dbg
(
obj
,
"opening config file (%s)"
,
filename
);
msg_Dbg
(
p_obj
,
"opening config file (%s)"
,
psz_filename
);
FILE
*
stream
=
utf8_fopen
(
filename
,
mode
);
p_stream
=
utf8_fopen
(
psz_filename
,
mode
);
if
((
stream
==
NULL
)
&&
(
errno
!=
ENOENT
)
)
if
(
p_stream
==
NULL
&&
errno
!=
ENOENT
)
msg_Err
(
obj
,
"cannot open config file (%s): %s"
,
strerror
(
errno
)
);
msg_Err
(
p_obj
,
"cannot open config file (%s): %s"
,
psz_filename
,
strerror
(
errno
)
);
return
stream
;
return
p_
stream
;
}
}
...
...
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