* [meta-oe][PATCH 2/5] wvstreams: Fix build with gcc10
2019-12-27 3:56 [meta-multimedia][PATCH 1/5] mpd: Fix build with gcc10 Khem Raj
@ 2019-12-27 3:56 ` Khem Raj
2019-12-27 3:56 ` [meta-multimedia][PATCH 3/5] tvheadend: Fix format-truncation warnings Khem Raj
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2019-12-27 3:56 UTC (permalink / raw)
To: openembedded-devel
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../0001-Fix-narrowing-conversion-error.patch | 29 +++++++++++++++++++
.../wvdial/wvstreams_4.6.1.bb | 1 +
2 files changed, 30 insertions(+)
create mode 100644 meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Fix-narrowing-conversion-error.patch
diff --git a/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Fix-narrowing-conversion-error.patch b/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Fix-narrowing-conversion-error.patch
new file mode 100644
index 0000000000..fc9abd8e63
--- /dev/null
+++ b/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Fix-narrowing-conversion-error.patch
@@ -0,0 +1,29 @@
+From c86c524f951f6e973473bfee76fd5366368b2cbc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 25 Dec 2019 09:32:41 -0800
+Subject: [PATCH] Fix narrowing conversion error
+
+xplc/moduleloader.cc: In static member function 'static Module* Module::loadModule(const char*)': xplc/moduleloader.cc:67:14: error: narrowing conversion of '-1' from 'int' to 'unsigned int' [-Wnarrowing] 67 | case (int)-1: | ^
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ xplc/moduleloader.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/xplc/moduleloader.cc b/xplc/moduleloader.cc
+index 02dd9a4..c53f5d2 100644
+--- a/xplc/moduleloader.cc
++++ b/xplc/moduleloader.cc
+@@ -62,7 +62,7 @@ Module* Module::loadModule(const char* modulename) {
+ return NULL;
+ }
+
+- switch(moduleinfo->version_major) {
++ switch((int)moduleinfo->version_major) {
+ #ifdef UNSTABLE
+ case -1:
+ /* nothing to do */
+--
+2.24.1
+
diff --git a/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb b/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb
index b220f9c1bc..20becaf57d 100644
--- a/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb
+++ b/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb
@@ -22,6 +22,7 @@ SRC_URI = "http://${BPN}.googlecode.com/files/${BP}.tar.gz \
file://0002-wvrules.mk-Use-_DEFAULT_SOURCE.patch \
file://openssl-buildfix.patch \
file://0001-Forward-port-to-OpenSSL-1.1.x.patch \
+ file://0001-Fix-narrowing-conversion-error.patch \
"
SRC_URI[md5sum] = "2760dac31a43d452a19a3147bfde571c"
--
2.24.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [meta-multimedia][PATCH 3/5] tvheadend: Fix format-truncation warnings
2019-12-27 3:56 [meta-multimedia][PATCH 1/5] mpd: Fix build with gcc10 Khem Raj
2019-12-27 3:56 ` [meta-oe][PATCH 2/5] wvstreams: " Khem Raj
@ 2019-12-27 3:56 ` Khem Raj
2019-12-27 3:56 ` [meta-oe][PATCH 4/5] open-vm-tools: Ignore -Warray-bounds Khem Raj
2019-12-27 3:56 ` [meta-networking][PATCH 5/5] ippool: Fix strncpy -Wformat-truncation warning Khem Raj
3 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2019-12-27 3:56 UTC (permalink / raw)
To: openembedded-devel
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Andreas Müller <schnitzeltony@gmail.com>
---
.../0001-allocate-space-for-buf-on-heap.patch | 46 +++++++++++++++++++
.../recipes-dvb/tvheadend/tvheadend_git.bb | 1 +
2 files changed, 47 insertions(+)
create mode 100644 meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch
diff --git a/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch b/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch
new file mode 100644
index 0000000000..cbd76b6abf
--- /dev/null
+++ b/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
+
diff --git a/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb b/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb
index a818a961f3..20faef047e 100644
--- a/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb
+++ b/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.md;md5=9cae5acac2e9ee2fc3aec01ac88ce5db"
SRC_URI = "git://github.com/tvheadend/tvheadend.git \
file://0001-adjust-for-64bit-time_t.patch \
+ file://0001-allocate-space-for-buf-on-heap.patch \
"
SRCREV = "fda89e85e0b6ae796d8a09e178d3937aa7869270"
--
2.24.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [meta-oe][PATCH 4/5] open-vm-tools: Ignore -Warray-bounds
2019-12-27 3:56 [meta-multimedia][PATCH 1/5] mpd: Fix build with gcc10 Khem Raj
2019-12-27 3:56 ` [meta-oe][PATCH 2/5] wvstreams: " Khem Raj
2019-12-27 3:56 ` [meta-multimedia][PATCH 3/5] tvheadend: Fix format-truncation warnings Khem Raj
@ 2019-12-27 3:56 ` Khem Raj
2019-12-27 3:56 ` [meta-networking][PATCH 5/5] ippool: Fix strncpy -Wformat-truncation warning Khem Raj
3 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2019-12-27 3:56 UTC (permalink / raw)
To: openembedded-devel
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
...1-utilBacktrace-Ignore-Warray-bounds.patch | 33 +++++++++++++++++++
.../open-vm-tools/open-vm-tools_11.0.1.bb | 1 +
2 files changed, 34 insertions(+)
create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-utilBacktrace-Ignore-Warray-bounds.patch
diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-utilBacktrace-Ignore-Warray-bounds.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-utilBacktrace-Ignore-Warray-bounds.patch
new file mode 100644
index 0000000000..95664e8552
--- /dev/null
+++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-utilBacktrace-Ignore-Warray-bounds.patch
@@ -0,0 +1,33 @@
+From ac3f93ea087d3a5461fe57fe021d0fe9a959e13c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 25 Dec 2019 15:25:02 -0800
+Subject: [PATCH] utilBacktrace: Ignore -Warray-bounds
+
+This is new warning with gcc10, until its fixed ignore it like gcc<10
+did
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ open-vm-tools/lib/user/utilBacktrace.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/open-vm-tools/lib/user/utilBacktrace.c b/open-vm-tools/lib/user/utilBacktrace.c
+index b72340ad..97ca53f2 100644
+--- a/open-vm-tools/lib/user/utilBacktrace.c
++++ b/open-vm-tools/lib/user/utilBacktrace.c
+@@ -517,6 +517,11 @@ Util_BacktraceWithFunc(int bugNr, // IN:
+ } else {
+ outFunc(outFuncData, "Backtrace for bugNr=%d\n",bugNr);
+ }
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Warray-bounds"
++
+ Util_BacktraceFromPointerWithFunc(&x[-2], outFunc, outFuncData);
++#pragma GCC diagnostic pop
+ #endif
+ }
++
+--
+2.24.1
+
diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb b/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb
index 9e4aa4881a..eda77c2060 100644
--- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb
+++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb
@@ -41,6 +41,7 @@ SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https \
file://0001-GitHub-Issue-367.-Remove-references-to-deprecated-G_.patch;patchdir=.. \
file://0001-Make-HgfsConvertFromNtTimeNsec-aware-of-64-bit-time_.patch;patchdir=.. \
file://0002-hgfsServerLinux-Consider-64bit-time_t-possibility.patch;patchdir=.. \
+ file://0001-utilBacktrace-Ignore-Warray-bounds.patch;patchdir=.. \
"
SRCREV = "d3edfd142a81096f9f58aff17d84219b457f4987"
--
2.24.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [meta-networking][PATCH 5/5] ippool: Fix strncpy -Wformat-truncation warning
2019-12-27 3:56 [meta-multimedia][PATCH 1/5] mpd: Fix build with gcc10 Khem Raj
` (2 preceding siblings ...)
2019-12-27 3:56 ` [meta-oe][PATCH 4/5] open-vm-tools: Ignore -Warray-bounds Khem Raj
@ 2019-12-27 3:56 ` Khem Raj
2019-12-27 5:26 ` Adrian Bunk
2019-12-27 8:12 ` Adrian Bunk
3 siblings, 2 replies; 8+ messages in thread
From: Khem Raj @ 2019-12-27 3:56 UTC (permalink / raw)
To: openembedded-devel
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../ippool/ippool/strncpy-truncation.patch | 35 +++++++++++++++++++
.../recipes-daemons/ippool/ippool_1.3.bb | 1 +
2 files changed, 36 insertions(+)
create mode 100644 meta-networking/recipes-daemons/ippool/ippool/strncpy-truncation.patch
diff --git a/meta-networking/recipes-daemons/ippool/ippool/strncpy-truncation.patch b/meta-networking/recipes-daemons/ippool/ippool/strncpy-truncation.patch
new file mode 100644
index 0000000000..28cad001db
--- /dev/null
+++ b/meta-networking/recipes-daemons/ippool/ippool/strncpy-truncation.patch
@@ -0,0 +1,35 @@
+Replace strncpy with memcpy
+
+since the length of data to
+be copied has already been determined with strlen(). Replace strncpy()
+with memcpy() to address the warning and optimize the code a little.
+
+| ippool_config.c:112:2: note: 'snprintf' output between 8 and 55 bytes into a destination of size 48
+| 112 | snprintf(prompt, sizeof(prompt), "ippool-%s", server_name);
+| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+--- a/cli/cli_readline.c
++++ b/cli/cli_readline.c
+@@ -261,6 +261,11 @@ static void cli_rl_display_wrapped_text(
+ if (left_margin == 0) {
+ left_margin = 3;
+ }
++
++ if (left_margin >= strlen(text_buf)) {
++ left_margin = strlen(text_buf);
++ }
++
+ if (right_margin == 0) {
+ right_margin = 78;;
+ }
+@@ -271,7 +276,7 @@ static void cli_rl_display_wrapped_text(
+ /* First copy the text heading to the buffer and add a "-", accounting for
+ * the specified left margin.
+ */
+- strncpy(&text_buf[0], text1, left_margin - 3);
++ memcpy(&text_buf[0], text1, left_margin - 3);
+ for (pos = strlen(text1); pos < left_margin - 3; pos++) {
+ text_buf[pos] = ' ';
+ }
diff --git a/meta-networking/recipes-daemons/ippool/ippool_1.3.bb b/meta-networking/recipes-daemons/ippool/ippool_1.3.bb
index 6fa46904b3..3554e688ab 100644
--- a/meta-networking/recipes-daemons/ippool/ippool_1.3.bb
+++ b/meta-networking/recipes-daemons/ippool/ippool_1.3.bb
@@ -26,6 +26,7 @@ SRC_URI = "https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-$
file://0003-cli-Mark-return-of-strtol-as-long-int.patch \
file://0002-link-with-libtirpc.patch \
file://0003-musl-fixes.patch \
+ file://strncpy-truncation.patch \
"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4c59283b82fc2b166455e0fc23c71c6f"
--
2.24.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [meta-networking][PATCH 5/5] ippool: Fix strncpy -Wformat-truncation warning
2019-12-27 3:56 ` [meta-networking][PATCH 5/5] ippool: Fix strncpy -Wformat-truncation warning Khem Raj
@ 2019-12-27 5:26 ` Adrian Bunk
2019-12-27 8:12 ` Adrian Bunk
1 sibling, 0 replies; 8+ messages in thread
From: Adrian Bunk @ 2019-12-27 5:26 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-devel
On Thu, Dec 26, 2019 at 07:56:39PM -0800, Khem Raj wrote:
>...
> +| ippool_config.c:112:2: note: 'snprintf' output between 8 and 55 bytes into a destination of size 48
> +| 112 | snprintf(prompt, sizeof(prompt), "ippool-%s", server_name);
> +| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +Upstream-Status: Pending
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +--- a/cli/cli_readline.c
> ++++ b/cli/cli_readline.c
>...
Is this a paste of the wrong warning?
The patch is in a different file in code that looks unrelated.
cu
Adrian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [meta-networking][PATCH 5/5] ippool: Fix strncpy -Wformat-truncation warning
2019-12-27 3:56 ` [meta-networking][PATCH 5/5] ippool: Fix strncpy -Wformat-truncation warning Khem Raj
2019-12-27 5:26 ` Adrian Bunk
@ 2019-12-27 8:12 ` Adrian Bunk
2019-12-27 8:48 ` Khem Raj
1 sibling, 1 reply; 8+ messages in thread
From: Adrian Bunk @ 2019-12-27 8:12 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-devel
On Thu, Dec 26, 2019 at 07:56:39PM -0800, Khem Raj wrote:
>...
> +--- a/cli/cli_readline.c
> ++++ b/cli/cli_readline.c
> +@@ -261,6 +261,11 @@ static void cli_rl_display_wrapped_text(
> + if (left_margin == 0) {
> + left_margin = 3;
> + }
> ++
> ++ if (left_margin >= strlen(text_buf)) {
> ++ left_margin = strlen(text_buf);
> ++ }
>...
This doesn't make sense, text_buf is an uninitialized variable.
cu
Adrian
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [meta-networking][PATCH 5/5] ippool: Fix strncpy -Wformat-truncation warning
2019-12-27 8:12 ` Adrian Bunk
@ 2019-12-27 8:48 ` Khem Raj
0 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2019-12-27 8:48 UTC (permalink / raw)
To: Adrian Bunk; +Cc: openembeded-devel
On Fri, Dec 27, 2019 at 12:12 AM Adrian Bunk <bunk@stusta.de> wrote:
>
> On Thu, Dec 26, 2019 at 07:56:39PM -0800, Khem Raj wrote:
> >...
> > +--- a/cli/cli_readline.c
> > ++++ b/cli/cli_readline.c
> > +@@ -261,6 +261,11 @@ static void cli_rl_display_wrapped_text(
> > + if (left_margin == 0) {
> > + left_margin = 3;
> > + }
> > ++
> > ++ if (left_margin >= strlen(text_buf)) {
> > ++ left_margin = strlen(text_buf);
> > ++ }
> >...
>
> This doesn't make sense, text_buf is an uninitialized variable.
>
I had it replaced with 128 already, this patch can be ignored
> cu
> Adrian
^ permalink raw reply [flat|nested] 8+ messages in thread