From fe66e6d0e109b7b13df7a9b0917262b19e983d92 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Fri, 9 Oct 2026 16:42:15 -0400 Subject: [PATCH] dsp: Prevent unsafe copying of CTCSSDetector Explicitly delete the copy constructor and copy assignment operator for CTCSSDetector to prevent accidental duplication of its detector state. Copying could duplicate internal detection state and coefficients, leading to unintended behavior if instances are expected to maintain independent processing state. Since CTCSSDetector is not intended to be copied or assigned, prohibit both operations at compile time. cppcheck identified the missing copy constructor and assignment operator with its noCopyConstructor and noOperatorEq warnings. Signed-off-by: Robin Getz --- sdrbase/dsp/ctcssdetector.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdrbase/dsp/ctcssdetector.h b/sdrbase/dsp/ctcssdetector.h index d2304c0bf..a4510d99b 100644 --- a/sdrbase/dsp/ctcssdetector.h +++ b/sdrbase/dsp/ctcssdetector.h @@ -32,6 +32,8 @@ class SDRBASE_API CTCSSDetector { public: CTCSSDetector(); virtual ~CTCSSDetector(); + CTCSSDetector(const CTCSSDetector&) = delete; + CTCSSDetector& operator=(const CTCSSDetector&) = delete; // setup the basic parameters and coefficients void setCoefficients(