commit 0535db47ec0bc332d4ba17b2f2e8c4a1bddbc79c
Author: Jakub Bogusz <[email protected]>
Date:   Sat Apr 8 12:18:12 2023 +0200

    - added patch to remove two unused functions which trigger use-after-free 
warning

 bctoolbox-use-after-free.patch | 23 +++++++++++++++++++++++
 bctoolbox.spec                 |  2 ++
 2 files changed, 25 insertions(+)
---
diff --git a/bctoolbox.spec b/bctoolbox.spec
index c4eca4f..982f08d 100644
--- a/bctoolbox.spec
+++ b/bctoolbox.spec
@@ -19,6 +19,7 @@ Group:                Libraries
 Source0:       
https://gitlab.linphone.org/BC/public/bctoolbox/-/archive/%{version}/%{name}-%{version}.tar.bz2
 # Source0-md5: bd3d6423b8fcc03035109434d74ca4c0
 Patch0:                %{name}-mbedtlsv3.patch
+Patch1:                %{name}-use-after-free.patch
 URL:           https://linphone.org/
 BuildRequires: bcunit-devel >= 5.2.0
 BuildRequires: cmake >= 3.2
@@ -67,6 +68,7 @@ Statyczne biblioteki bctoolbox.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 install -d builddir
diff --git a/bctoolbox-use-after-free.patch b/bctoolbox-use-after-free.patch
new file mode 100644
index 0000000..5af587a
--- /dev/null
+++ b/bctoolbox-use-after-free.patch
@@ -0,0 +1,23 @@
+Remove two functions which return pointer to deleted object:
+bctoolbox-5.2.49/src/containers/map.cc:234:16: error: pointer 'it' used after 
'void operator delete(void*)' [-Werror=use-after-free]
+bctoolbox-5.2.49/src/containers/map.cc:239:16: error: pointer 'it' used after 
'void operator delete(void*)' [-Werror=use-after-free]
+
+--- bctoolbox-5.2.49/src/containers/map.cc.orig        2023-04-06 
12:17:19.000000000 +0200
++++ bctoolbox-5.2.49/src/containers/map.cc     2023-04-08 12:09:02.613758031 
+0200
+@@ -228,16 +228,6 @@ extern "C" bctbx_iterator_t *bctbx_itera
+ extern "C" bctbx_iterator_t *bctbx_iterator_cchar_get_next(bctbx_iterator_t 
*it) {
+       return bctbx_iterator_get_next_type<mmap_cchar_t>(it);
+ }
+-extern "C" bctbx_iterator_t 
*bctbx_iterator_ullong_get_next_and_delete(bctbx_iterator_t *it) {
+-      bctbx_iterator_t * next = bctbx_iterator_ullong_get_next(it);
+-      bctbx_iterator_ullong_delete(it);
+-      return next;
+-}
+-extern "C" bctbx_iterator_t 
*bctbx_iterator_cchar_get_next_and_delete(bctbx_iterator_t *it) {
+-      bctbx_iterator_t * next = bctbx_iterator_cchar_get_next(it);
+-      bctbx_iterator_cchar_delete(it);
+-      return next;
+-}
+ 
+ template<typename T> bool_t bctbx_iterator_equals_type(const bctbx_iterator_t 
*a,const bctbx_iterator_t *b) {
+       return *(typename T::iterator*)a == *(typename T::iterator*)b;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/bctoolbox.git/commitdiff/0535db47ec0bc332d4ba17b2f2e8c4a1bddbc79c

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to