From 5bdd21f915d1af832e9d3b874ddbd3ba2a178a06 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 4 Jan 2026 17:25:38 +0100 Subject: solver3: Ensure rule-of-3 memory safety for ContiguousCacheMap --- apt-pkg/solver3.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h index 6fa00933f..4a2b4ac8d 100644 --- a/apt-pkg/solver3.h +++ b/apt-pkg/solver3.h @@ -59,6 +59,10 @@ class ContiguousCacheMap V &operator[](const K *key) { return data_[key->ID]; } const V &operator[](const K *key) const { return data_[key->ID]; } ~ContiguousCacheMap() { delete[] data_; } + + // Delete copy constructors for memory safety (rule of 3) + ContiguousCacheMap(const ContiguousCacheMap &) = delete; + ContiguousCacheMap &operator=(const ContiguousCacheMap &) = delete; }; /** -- cgit v1.2.3-70-g09d2