From 31c4f2b380b2ca14d358469ed423167cd004bfff Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Fri, 9 Oct 2026 16:37:31 -0400 Subject: [PATCH] moddatv/dvb-s: Prevent unsafe copying of DVBS Explicitly delete the copy constructor and copy assignment operator for DVBS, which manages resources that should not be shared through implicit shallow copies. The implicitly generated copy operations could leave multiple DVBS instances referring to the same resources, potentially causing invalid ownership or double deletion. Since DVBS is not intended to be copied or assigned, prohibit both operations at compile time to prevent unsafe resource ownership. cppcheck identified the missing copy constructor and assignment operator with its noCopyConstructor and noOperatorEq warnings. Signed-off-by: Robin Getz --- plugins/channeltx/moddatv/dvb-s/dvb-s.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/channeltx/moddatv/dvb-s/dvb-s.h b/plugins/channeltx/moddatv/dvb-s/dvb-s.h index 54cfc906d..e1e5ef38c 100644 --- a/plugins/channeltx/moddatv/dvb-s/dvb-s.h +++ b/plugins/channeltx/moddatv/dvb-s/dvb-s.h @@ -36,6 +36,8 @@ public: DVBS(); ~DVBS(); + DVBS(const DVBS&) = delete; + DVBS& operator=(const DVBS&) = delete; int encode(const uint8_t *ts, uint8_t *iq); void setCodeRate(CodeRate codeRate);