]> git.pld-linux.org Git - packages/bctoolbox.git/blobdiff - bctoolbox-use-after-free.patch
- added patch to remove two unused functions which trigger use-after-free warning
[packages/bctoolbox.git] / bctoolbox-use-after-free.patch
diff --git a/bctoolbox-use-after-free.patch b/bctoolbox-use-after-free.patch
new file mode 100644 (file)
index 0000000..5af587a
--- /dev/null
@@ -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;
This page took 0.158931 seconds and 4 git commands to generate.