Browse Source

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 <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 1 month ago
parent
commit
31c4f2b380
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 2
      plugins/channeltx/moddatv/dvb-s/dvb-s.h

2
plugins/channeltx/moddatv/dvb-s/dvb-s.h

@ -36,6 +36,8 @@ public: @@ -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);

Loading…
Cancel
Save