MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / unpack

Function unpack

src/jrd/vio.cpp:573–601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571namespace
572{
573 inline UCHAR* unpack(record_param* rpb, ULONG outLength, UCHAR* output)
574 {
575 if (rpb->rpb_flags & rpb_not_packed)
576 {
577 const auto length = MIN(rpb->rpb_length, outLength);
578
579 memcpy(output, rpb->rpb_address, length);
580 output += length;
581
582 if (rpb->rpb_length > length)
583 {
584 // Short records may be zero-padded up to the fragmented header size.
585 // Take it into account while checking for a possible buffer overrun.
586
587 auto tail = rpb->rpb_address + length;
588 const auto end = rpb->rpb_address + rpb->rpb_length;
589
590 while (tail < end)
591 {
592 if (*tail++)
593 BUGCHECK(179); // msg 179 decompression overran buffer
594 }
595 }
596
597 return output;
598 }
599
600 return Compressor::unpack(rpb->rpb_length, rpb->rpb_address, outLength, output);
601 }
602};
603
604

Callers 3

VIO_dataFunction · 0.85
delete_recordFunction · 0.85
delete_tailFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected