Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bouquet: don't crash tvh when duplicate files with identical source f…
…iles are loaded, fixes #3708
  • Loading branch information
perexg committed Apr 9, 2016
1 parent 71e8b00 commit ec1d815
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bouquet.c
Expand Up @@ -111,7 +111,11 @@ bouquet_create(const char *uuid, htsmsg_t *conf,
}

bq2 = RB_INSERT_SORTED(&bouquets, bq, bq_link, _bq_cmp);
assert(bq2 == NULL);
if (bq2) {
tvherror("bouquet", "found duplicate source id: '%s', remove duplicate config", bq->bq_src);
free(bq);
return NULL;
}

bq->bq_saveflag = 1;

Expand Down Expand Up @@ -1236,7 +1240,8 @@ bouquet_init(void)
HTSMSG_FOREACH(f, c) {
if (!(m = htsmsg_field_get_map(f))) continue;
bq = bouquet_create(f->hmf_name, m, NULL, NULL);
bq->bq_saveflag = 0;
if (bq)
bq->bq_saveflag = 0;
}
htsmsg_destroy(c);
}
Expand Down

0 comments on commit ec1d815

Please sign in to comment.