From c1ddfb59076e9b568484b97f10b4eadeb48384e3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 8 Feb 2013 23:50:21 +0100 Subject: Check return values of some mp_find_..._config_file function calls for NULL --- stream/stream_dvb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'stream') diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index 7cbd690ee6..3fa1b289a0 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -123,6 +123,9 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type) FILE *f; char line[CHANNEL_LINE_LEN], *colon; + if (!filename) + return NULL; + int fields, cnt, pcnt, k; int has8192, has0; dvb_channel_t *ptr, *tmp, chn; @@ -799,11 +802,11 @@ dvb_config_t *dvb_get_config(void) break; } - if((access(conf_file, F_OK | R_OK) != 0)) { + if(conf_file && (access(conf_file, F_OK | R_OK) != 0)) { conf_file = talloc_steal(talloc_ctx, mp_find_user_config_file("channels.conf")); - if((access(conf_file, F_OK | R_OK) != 0)) { + if(conf_file && (access(conf_file, F_OK | R_OK) != 0)) { conf_file = talloc_steal(talloc_ctx, mp_find_global_config_file("channels.conf")); } -- cgit v1.2.3