VITA49 icon indicating copy to clipboard operation
VITA49 copied to clipboard

Correct base class constructor not being called due to virtual inheritance

Open kalden2 opened this issue 2 years ago • 0 comments

When constructing a StandardContextPacket object, the default constructor builds a 32 byte packet buffer to be used for future packet modification. This buffer gets passed down to BasicContextPacket and finally to BasicVrtPacket. Because BasicContextPacket inherits from BasicVrtPacket virtually, BasicVrtPacket's default constructor is called instead of the correct one with the buffer built by StandardContextPacket. This causes a number of crashing issues due to the buffer being too small.

The fix for this is to construct BasicVrtPacket directly from StandardContextPacket.

kalden2 avatar Jan 27 '23 16:01 kalden2