From: Jaroslav Kysela Date: Wed, 21 Mar 2012 08:29:49 +0000 (+0100) Subject: Fix crash when cfg->dvr_config_name is NULL (default config) X-Git-Tag: 2.99^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4b88cfc39354043ce7bcaf09a28f0ea44a0983b;p=thirdparty%2Ftvheadend.git Fix crash when cfg->dvr_config_name is NULL (default config) As suggested by opdenkamp - the cfg->dvr_config_name may be NULL in some cases. Add more restrictive checks in extjs_dvr() . --- diff --git a/src/webui/extjs.c b/src/webui/extjs.c index b4677e227..647f28ffb 100644 --- a/src/webui/extjs.c +++ b/src/webui/extjs.c @@ -794,12 +794,13 @@ extjs_dvr(http_connection_t *hc, const char *remain, void *opaque) if (http_access_verify(hc, ACCESS_RECORDER_ALL)) { config_name = NULL; LIST_FOREACH(cfg, &dvrconfigs, config_link) { - if (strcmp(cfg->dvr_config_name, hc->hc_username) == 0) { + if (cfg->dvr_config_name && hc->hc_username && + strcmp(cfg->dvr_config_name, hc->hc_username) == 0) { config_name = cfg->dvr_config_name; break; } } - if (config_name == NULL) + if (config_name == NULL && hc->hc_username) tvhlog(LOG_INFO,"dvr","User '%s' has no dvr config with identical name, using default...", hc->hc_username); }