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() . This patch fixes the second location for the user check.
This commit is contained in:
parent
e4b88cfc39
commit
6097dcd6d1
1 changed files with 3 additions and 2 deletions
|
@ -877,12 +877,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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue