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
Show 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 )
}
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
;
const
char
*
filename
=
obj
->
p_libvlc
->
psz_configfile
;
const
char
*
homedir
;
size_t
buflen
=
0
;
static
const
char
psz_subpath
[]
=
DIR_SEP
CONFIG_DIR
DIR_SEP
CONFIG_FILE
;
const
char
*
psz_filename
=
p_obj
->
p_libvlc
->
psz_configfile
;
const
char
*
psz_homedir
;
size_t
i_buflen
=
0
;
FILE
*
p_stream
;
if
(
filename
==
NULL
)
if
(
psz_filename
==
NULL
)
{
homedir
=
obj
->
p_libvlc
->
psz_homedir
;
if
(
homedir
==
NULL
)
psz_homedir
=
p_
obj
->
p_libvlc
->
psz_homedir
;
if
(
psz_homedir
==
NULL
)
{
msg_Err
(
obj
,
"no home directory defined"
);
msg_Err
(
p_obj
,
"no home directory defined"
);
return
NULL
;
}
buflen
=
strlen
(
homedir
)
+
sizeof
(
subpath
)
;
i_buflen
=
strlen
(
psz_homedir
)
+
sizeof
(
psz_subpath
)
+
1
;
}
char
buf
[
buflen
];
if
(
filename
==
NULL
)
char
buf
[
i_
buflen
];
if
(
psz_filename
==
NULL
)
{
sprintf
(
buf
,
"%s%s"
,
homedir
,
subpath
);
filename
=
buf
;
sprintf
(
buf
,
"%s%s"
,
psz_homedir
,
psz_subpath
);
psz_
filename
=
buf
;
}
msg_Dbg
(
obj
,
"opening config file (%s)"
,
filename
);
FILE
*
stream
=
utf8_fopen
(
filename
,
mode
);
if
((
stream
==
NULL
)
&&
(
errno
!=
ENOENT
)
)
msg_Err
(
obj
,
"cannot open config file (%s): %s"
,
strerror
(
errno
)
);
msg_Dbg
(
p_obj
,
"opening config file (%s)"
,
psz_filename
);
p_stream
=
utf8_fopen
(
psz_filename
,
mode
);
if
(
p_stream
==
NULL
&&
errno
!=
ENOENT
)
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