From: Flole998 Date: Mon, 8 Jun 2020 19:46:22 +0000 (+0200) Subject: Allocate space for buf on heap (modified PR #1324) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1031ce5d55275e1606643133b8168adcbe5f231;p=thirdparty%2Ftvheadend.git Allocate space for buf on heap (modified PR #1324) --- diff --git a/src/epggrab/module/xmltv.c b/src/epggrab/module/xmltv.c index d48bdbbb1..fa36640f7 100644 --- a/src/epggrab/module/xmltv.c +++ b/src/epggrab/module/xmltv.c @@ -197,7 +197,8 @@ static void parse_xmltv_dd_progid (epggrab_module_t *mod, const char *s, char **uri, char **suri, epg_episode_num_t *epnum) { - if (strlen(s) < 2) return; + const int s_len = strlen(s); + if (s_len < 2) return; const int buf_size = s_len + strlen(mod->id) + 13; char * buf = (char *) malloc( buf_size); @@ -212,7 +213,6 @@ static void parse_xmltv_dd_progid /* Episode */ if (!strncmp("EP", s, 2)) { - int e = strlen(buf)-1; while (--e && buf[e] != '.') {} if (e) { buf[e] = '\0';