File 0005-Remove-dangerous-ptrList-assignment-operator.patch of Package libSNL
From 2645101051d94a2062ac30a0c084c20a6dd86ab0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 17 Nov 2024 08:16:46 +0100
Subject: [PATCH 5/5] Remove dangerous ptrList assignment operator
The semantics of the implementation are broken. According the method
signature the RHS should not be modified (const), but the implementation
moves the content ownership to the LHS.
---
trunk/src/ptrList.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/trunk/src/ptrList.h b/trunk/src/ptrList.h
index 09d6cd7..ee23c32 100644
--- a/trunk/src/ptrList.h
+++ b/trunk/src/ptrList.h
@@ -38,7 +38,7 @@ template < class T > class ptrListItem
// Operators
- ptrListItem<T>& operator= ( const ptrListItem<T>& item );
+ // ptrListItem<T>& operator= ( const ptrListItem<T>& item );
// Linked list functions.
ptrListItem<T>* next();
@@ -200,6 +200,7 @@ template < class T > ptrListItem<T>::ptrListItem ( T* ptr, ptrListItem<T>* chain
prevLnk = 0;
}
+#if 0
template < class T > ptrListItem<T>& ptrListItem<T>::operator= ( const ptrListItem<T>& item )
{
// Assignment Operator.
@@ -220,6 +221,7 @@ template < class T > ptrListItem<T>& ptrListItem<T>::operator= ( const ptrListIt
return *this;
}
+#endif
template < class T > ptrListItem<T>* ptrListItem<T>::next()
{
--
2.47.0