From cdeaf71f6db4985b87791c7c7a48fe6dc73683e2 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Fri, 9 Oct 2026 16:29:11 -0400 Subject: [PATCH] demoddatv/leansdr: Prevent unsafe copying of DVB-S2 processing classes Explicitly delete the copy constructors and copy assignment operators for s2_frame_receiver and s2_fecdec_soft. These processing classes manage state and resources that should not be duplicated through implicit shallow copies. Prohibiting copying and assignment prevents accidental duplication of internal state and potentially unsafe resource ownership. cppcheck identified the missing copy constructors and assignment operators with its noCopyConstructor and noOperatorEq warnings. Signed-off-by: Robin Getz --- plugins/channelrx/demoddatv/leansdr/dvbs2.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/channelrx/demoddatv/leansdr/dvbs2.h b/plugins/channelrx/demoddatv/leansdr/dvbs2.h index 78865401e..26b6d9ca7 100644 --- a/plugins/channelrx/demoddatv/leansdr/dvbs2.h +++ b/plugins/channelrx/demoddatv/leansdr/dvbs2.h @@ -675,6 +675,9 @@ struct s2_frame_receiver : runnable } } + s2_frame_receiver(const s2_frame_receiver&) = delete; + s2_frame_receiver& operator=(const s2_frame_receiver&) = delete; + enum { FRAME_DETECT, // Looking for PLHEADER FRAME_PROBE, // Aligned with PLHEADER, ready to recover carrier @@ -3136,6 +3139,9 @@ struct s2_fecdec_soft : runnable } } + s2_fecdec_soft(const s2_fecdec_soft&) = delete; + s2_fecdec_soft& operator=(const s2_fecdec_soft&) = delete; + void run() { while (in.readable() >= 1 &&