HomeClusterLabs Projects

Refactor: libcrmcommon: Sanity-check remote message and buffer sizes
7e60792cd33eUnpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

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>

Details

Provenance
nrwahl2Authored on Mar 8 2025, 1:55 AM
Parents
rPe5b649e7cdb2: Refactor: libcrmcommon: Use GLib functions for swapping byte order
Branches
Unknown
Tags
Unknown

Event Timeline