summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch
diff options
context:
space:
mode:
authortakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
committertakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
commit1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch)
treecd70a267a5ef105ba32f200aa088e281fbd85747 /external/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch
parent4204309872da5cb401cbb2729d9e2d4869a87f42 (diff)
recipes
Diffstat (limited to 'external/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch')
-rw-r--r--external/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/external/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch b/external/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch
new file mode 100644
index 00000000..cbd76b6a
--- /dev/null
+++ b/external/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch
@@ -0,0 +1,46 @@
+From d4a405f87fc215c14e610a25b5a6b14060c1ef15 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 25 Dec 2019 13:53:52 -0800
+Subject: [PATCH] allocate space for buf on heap
+
+Avoids
+| src/epggrab/module/xmltv.c:204:47: error: '%s' directive output may be truncated writing between 2 and 2147483645 bytes into a region of size 115 [-Werror=format-truncation=]
+| 204 | snprintf(buf, sizeof(buf)-1, "ddprogid://%s/%s", mod->id, s);
+| | ^~
+
+Upstream-Status: Submitted [https://github.com/tvheadend/tvheadend/pull/1324]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/epggrab/module/xmltv.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/epggrab/module/xmltv.c b/src/epggrab/module/xmltv.c
+index 34ab05bdb..b1a956614 100644
+--- a/src/epggrab/module/xmltv.c
++++ b/src/epggrab/module/xmltv.c
+@@ -197,11 +197,12 @@ static void parse_xmltv_dd_progid
+ (epggrab_module_t *mod, const char *s, char **uri, char **suri,
+ epg_episode_num_t *epnum)
+ {
+- char buf[128];
+ if (strlen(s) < 2) return;
+
++ char* buf = (char *)malloc(strlen(s) + strlen(mod->id) + 13);
++ buf[strlen(s) + strlen(mod->id) + 12] = '\0';
+ /* Raw URI */
+- snprintf(buf, sizeof(buf)-1, "ddprogid://%s/%s", mod->id, s);
++ snprintf(buf, strlen(s) + strlen(mod->id) + 12, "ddprogid://%s/%s", mod->id, s);
+
+ /* SH - series without episode id so ignore */
+ if (strncmp("SH", s, 2))
+@@ -219,6 +220,7 @@ static void parse_xmltv_dd_progid
+ if (buf[e+1]) sscanf(&buf[e+1], "%hu", &(epnum->e_num));
+ }
+ }
++ free(buf);
+ }
+
+ /**
+--
+2.24.1
+