diff options
2 files changed, 53 insertions, 1 deletions
diff --git a/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz/0001-http-fetch-Pass-a-non-null-buffer-to-ne_set_request_.patch b/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz/0001-http-fetch-Pass-a-non-null-buffer-to-ne_set_request_.patch new file mode 100644 index 0000000000..1fae37614c --- /dev/null +++ b/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz/0001-http-fetch-Pass-a-non-null-buffer-to-ne_set_request_.patch | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | From 06b2a6aa70616aafab780514d9d26e85bd98d965 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Thu, 25 Aug 2022 14:02:16 -0700 | ||
| 4 | Subject: [PATCH] http/fetch: Pass a non-null buffer to | ||
| 5 | ne_set_request_body_buffer API | ||
| 6 | |||
| 7 | Newer versions of neon has added a check for non-null arguments for | ||
| 8 | ne_set_request_body_buffer() API and this is triggered but older | ||
| 9 | compiler only treats -Wnonnull as warning so all was fine, however gcc | ||
| 10 | 12.2 has started to throw this warning as error by default and builds | ||
| 11 | are breaking | ||
| 12 | |||
| 13 | Fixes | ||
| 14 | src/HTTPFetch.cc:186:38: warning: null passed to a callee that requires a non-null argument [-Wnonnull] | ||
| 15 | ne_set_request_body_buffer(req,0,0); | ||
| 16 | ~ ^ | ||
| 17 | Upstream-Status: Submitted [https://github.com/metabrainz/libmusicbrainz/pull/18] | ||
| 18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 19 | --- | ||
| 20 | src/HTTPFetch.cc | 6 +++++- | ||
| 21 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
| 22 | |||
| 23 | diff --git a/src/HTTPFetch.cc b/src/HTTPFetch.cc | ||
| 24 | index baec359..0c0d919 100644 | ||
| 25 | --- a/src/HTTPFetch.cc | ||
| 26 | +++ b/src/HTTPFetch.cc | ||
| 27 | @@ -182,8 +182,10 @@ int MusicBrainz5::CHTTPFetch::Fetch(const std::string& URL, const std::string& R | ||
| 28 | } | ||
| 29 | |||
| 30 | ne_request *req = ne_request_create(sess, Request.c_str(), URL.c_str()); | ||
| 31 | + ne_buffer *body = ne_buffer_create(); | ||
| 32 | + | ||
| 33 | if (Request=="PUT") | ||
| 34 | - ne_set_request_body_buffer(req,0,0); | ||
| 35 | + ne_set_request_body_buffer(req, body->data, ne_buffer_size(body)); | ||
| 36 | |||
| 37 | if (Request!="GET") | ||
| 38 | ne_set_request_flag(req, NE_REQFLAG_IDEMPOTENT, 0); | ||
| 39 | @@ -195,6 +197,8 @@ int MusicBrainz5::CHTTPFetch::Fetch(const std::string& URL, const std::string& R | ||
| 40 | |||
| 41 | Ret=m_d->m_Data.size(); | ||
| 42 | |||
| 43 | + ne_buffer_destroy(body); | ||
| 44 | + | ||
| 45 | ne_request_destroy(req); | ||
| 46 | |||
| 47 | m_d->m_ErrorMessage = ne_get_error(sess); | ||
| 48 | -- | ||
| 49 | 2.37.2 | ||
| 50 | |||
diff --git a/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb b/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb index 803c6279ce..3b365444e2 100644 --- a/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb +++ b/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb | |||
| @@ -8,7 +8,9 @@ DEPENDS = "expat libxml2 libxml2-native neon neon-native libmusicbrainz-native" | |||
| 8 | PV = "5.1.0+git${SRCPV}" | 8 | PV = "5.1.0+git${SRCPV}" |
| 9 | 9 | ||
| 10 | SRCREV = "8be45b12a86bc0e46f2f836c8ac88e1e98d82aee" | 10 | SRCREV = "8be45b12a86bc0e46f2f836c8ac88e1e98d82aee" |
| 11 | SRC_URI = "git://github.com/metabrainz/libmusicbrainz.git;branch=master;protocol=https" | 11 | SRC_URI = "git://github.com/metabrainz/libmusicbrainz.git;branch=master;protocol=https \ |
| 12 | file://0001-http-fetch-Pass-a-non-null-buffer-to-ne_set_request_.patch \ | ||
| 13 | " | ||
| 12 | 14 | ||
| 13 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |
| 14 | 16 | ||
