----------------------------------------------------------------------------
| 1752 | |
| 1753 | //---------------------------------------------------------------------------- |
| 1754 | unsigned char* vtkClientServerStream::ParseString( |
| 1755 | int order, unsigned char* data, unsigned char* end) |
| 1756 | { |
| 1757 | // Read the string length. |
| 1758 | vtkTypeUInt32 length; |
| 1759 | if (data > end - sizeof(length)) |
| 1760 | { |
| 1761 | /* ERROR */ |
| 1762 | return nullptr; |
| 1763 | } |
| 1764 | this->PerformByteSwap(order, data, 1, sizeof(length)); |
| 1765 | memcpy(&length, data, sizeof(length)); |
| 1766 | data += sizeof(length); |
| 1767 | |
| 1768 | // Skip the string data. It does not need swapping. |
| 1769 | if (data > end - length) |
| 1770 | { |
| 1771 | /* ERROR */ |
| 1772 | return nullptr; |
| 1773 | } |
| 1774 | |
| 1775 | // Return the position after the string. |
| 1776 | return data + length; |
| 1777 | } |
| 1778 | |
| 1779 | //---------------------------------------------------------------------------- |
| 1780 | unsigned char* vtkClientServerStream::ParseStream( |
no test coverage detected