mpd: Fix build with gcc10
PATCH 1/5 mpd: Fix build with gcc10
--- ...ingBuffer-Include-cstddef-for-size_t.patch | 27 +++++++++++++ ...-Include-stdexcept-for-runtime_error.patch | 38 +++++++++++++++++++ .../recipes-multimedia/musicpd/mpd_0.20.22.bb | 2 + 3 files changed, 67 insertions(+) create mode 100644 meta-multimedia/recipes-multimedia/musicpd/mpd/0001-StringBuffer-Include-cstddef-for-size_t.patch create mode 100644 meta-multimedia/recipes-multimedia/musicpd/mpd/0002-Include-stdexcept-for-runtime_error.patch
meta-multimedia/recipes-multimedia/musicpd/mpd/0001-StringBuffer-Include-cstddef-for-size_t.patch new file +27 -0
@@ -0,0 +1,27 @@ +From c14877071f14b218835f7fb034dea11bd1ba56f5 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 25 Dec 2019 09:40:16 -0800 +Subject: [PATCH] StringBuffer: Include cstddef for size_t + +Fixes +a.cpp:3:1: error: 'size_t' does not name a type + 3 | size_t s; + | ^~~~~~ +a.cpp:2:1: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'? + +Upstream-Status: Submitted [https://github.com/MusicPlayerDaemon/MPD/pull/697] +Signed-off-by: Khem Raj <[email protected]> +--- + src/util/StringBuffer.hxx | 1 + + 1 file changed, 1 insertion(+) + +--- a/src/util/StringBuffer.hxx ++++ b/src/util/StringBuffer.hxx +@@ -31,6 +31,7 @@ + #define STRING_BUFFER_HPP + + #include <array> ++#include <cstddef> + + /** + * A statically allocated string buffer.
meta-multimedia/recipes-multimedia/musicpd/mpd/0002-Include-stdexcept-for-runtime_error.patch new file +38 -0
@@ -0,0 +1,38 @@ +From 06f78ced45f6622a2e02cd09e6a2c0c22a98b89e Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 25 Dec 2019 09:41:55 -0800 +Subject: [PATCH 2/2] Include <stdexcept> for runtime_error + +Fixes + +../git/src/LocateUri.cxx:65:14: error: 'runtime_error' is not a member of 'std' + 65 | throw std::runtime_error("Unsupported URI scheme"); + | ^~~~~~~~~~~~~ + +Upstream-Status: Inappropriate [ Fixed differently upstream ] +Signed-off-by: Khem Raj <[email protected]> +--- + src/LocateUri.cxx | 1 + + src/pcm/PcmConvert.cxx | 1 + + 2 files changed, 2 insertions(+) + +--- a/src/LocateUri.cxx ++++ b/src/LocateUri.cxx +@@ -17,6 +17,7 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + ++#include <stdexcept> + #include "config.h" + #include "LocateUri.hxx" + #include "client/Client.hxx" +--- a/src/pcm/PcmConvert.cxx ++++ b/src/pcm/PcmConvert.cxx +@@ -17,6 +17,7 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + ++#include <stdexcept> + #include "config.h" + #include "PcmConvert.hxx" + #include "ConfiguredResampler.hxx"
meta-multimedia/recipes-multimedia/musicpd/mpd_0.20.22.bb +2 -0
@@ -19,6 +19,8 @@ DEPENDS += " \ SRC_URI = " \ git://github.com/MusicPlayerDaemon/MPD;branch=v0.20.x \ file://mpd.conf.in \ + file://0001-StringBuffer-Include-cstddef-for-size_t.patch \ + file://0002-Include-stdexcept-for-runtime_error.patch \ " SRCREV = "9274bc15bc41bbe490fde847f8422468cc20375d" S = "${WORKDIR}/git"
Signature · 1 line
2.24.1
PATCH 2/5 wvstreams: Fix build with gcc10
--- .../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
meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Fix-narrowing-conversion-error.patch new file +29 -0
@@ -0,0 +1,29 @@ +From c86c524f951f6e973473bfee76fd5366368b2cbc Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +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 <[email protected]> +--- + 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 +
meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb +1 -0
@@ -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"
Signature · 1 line
2.24.1
PATCH 3/5 tvheadend: Fix format-truncation warnings
In reply to Khem Raj--- .../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
meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch new file +46 -0
@@ -0,0 +1,46 @@ +From d4a405f87fc215c14e610a25b5a6b14060c1ef15 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +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 <[email protected]> +--- + 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 +
meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb +1 -0
@@ -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"
Signature · 1 line
2.24.1
PATCH 4/5 open-vm-tools: Ignore -Warray-bounds
In reply to Khem Raj--- ...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
meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-utilBacktrace-Ignore-Warray-bounds.patch new file +33 -0
@@ -0,0 +1,33 @@ +From ac3f93ea087d3a5461fe57fe021d0fe9a959e13c Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +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 <[email protected]> +--- + 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 +
meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb +1 -0
@@ -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"
Signature · 1 line
2.24.1
PATCH 5/5 ippool: Fix strncpy -Wformat-truncation warning
In reply to Khem Raj--- .../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
meta-networking/recipes-daemons/ippool/ippool/strncpy-truncation.patch new file +35 -0
@@ -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 <[email protected]> +--- 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] = ' '; + }
meta-networking/recipes-daemons/ippool/ippool_1.3.bb +1 -0
@@ -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"
Signature · 1 line
2.24.1
Re: [meta-networking][PATCH 5/5] ippool: Fix strncpy -Wformat-truncation warning
meta-networking/recipes-daemons/ippool/ippool/strncpy-truncation.patch line 14
Quoted 10 lines · Khem Raj
...
+| 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); +| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~meta-networking/recipes-daemons/ippool/ippool/strncpy-truncation.patch new file +5
-0+ +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> +--- 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
Re: [meta-networking][PATCH 5/5] ippool: Fix strncpy -Wformat-truncation warning
In reply to Khem Rajmeta-networking/recipes-daemons/ippool/ippool/strncpy-truncation.patch line 22
Quoted 12 lines · Khem Raj
...
+---a/cli/cli_readline.c
++++b/cli/cli_readline.c
+@@ -261,6 +261,11 @@ static void cli_rl_display_wrapped_text(meta-networking/recipes-daemons/ippool/ippool/strncpy-truncation.patch new file +7
-0+ 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
Re: [meta-networking][PATCH 5/5] ippool: Fix strncpy -Wformat-truncation warning
Quoted 15 lines · Adrian Bunk
meta-networking/recipes-daemons/ippool/ippool/strncpy-truncation.patch line 22
Quoted 12 lines · Khem Raj
...
+---a/cli/cli_readline.c
++++b/cli/cli_readline.c
+@@ -261,6 +261,11 @@ static void cli_rl_display_wrapped_text(meta-networking/recipes-daemons/ippool/ippool/strncpy-truncation.patch new file +7
-0+ if (left_margin == 0) { + left_margin = 3; + } ++ ++ if (left_margin >= strlen(text_buf)) { ++ left_margin = strlen(text_buf); ++ }
Quoted 2 lines
This doesn't make sense,
text_bufis an uninitialized variable.
I had it replaced with 128 already, this patch can be ignored
Quoted 2 lines
cu
Adrian