| 490 | |
| 491 | |
| 492 | static USHORT getLen(const UCHAR** ptr, const UCHAR* bufferEnd) |
| 493 | { |
| 494 | if (bufferEnd - *ptr < 2) |
| 495 | fatal_exception::raise("Invalid info structure - no space for clumplet length"); |
| 496 | |
| 497 | const USHORT len = static_cast<USHORT>(gds__vax_integer(*ptr, 2)); |
| 498 | *ptr += 2; |
| 499 | |
| 500 | fb_assert(bufferEnd - *ptr >= len); |
| 501 | if (bufferEnd - *ptr < len) |
| 502 | fatal_exception::raiseFmt("Invalid info structure - no space for clumplet data: need %d, actual %d", |
| 503 | len, bufferEnd - *ptr); |
| 504 | |
| 505 | return len; |
| 506 | } |
| 507 | |
| 508 | |
| 509 | // Pick up a VAX format numeric info item with a 2 byte length. |
no test coverage detected