Refactor: libcrmcommon: Sanity-check remote message and buffer sizes
Coverity has been complaining about the payload_offset and
payload_uncompressed being tainted scalar values. There's only so much
validation we can do when we're reading from a socket. But apparently
this is enough, because it makes the Coverity errors go away.
There's a lot more room for improvement in the remote message
processing. I found a few bugs a while back that we need to fix
involving multiple messages received in rapid succession. This is an
improvement for now.
Note that I got rid of the CRM_LOG_ASSERT() line that subtracts 1 from
the index. As far as I can tell, that's an off-by-one error and we have
no reason to expect that position to contain a null byte. The commit
that added it doesn't have any information in the commit message or
comments.
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>