Implemented better testing and fixed skipepd frames
This commit is contained in:
@@ -517,7 +517,11 @@ void UDPStreamerClient::DecodeSnapshot(const uint8 *payload, uint32 size,
|
||||
const bool accScalar = (publishMode == UDPS_PUBLISH_ACCUMULATE) && (ne == 1u);
|
||||
const uint32 elemsToRead = accScalar ? numSamples : ne;
|
||||
|
||||
if ((off + (elemsToRead * wireElemBytes)) > size) { return; }
|
||||
/* HI-1: 64-bit bounds check to prevent uint32 multiply overflow */
|
||||
uint64 bytesNeeded = static_cast<uint64>(off) +
|
||||
static_cast<uint64>(elemsToRead) *
|
||||
static_cast<uint64>(wireElemBytes);
|
||||
if (bytesNeeded > static_cast<uint64>(size)) { return; }
|
||||
|
||||
uint8 *d = dst + info.bufferOffset;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user