Fix fragmentation & typo (#213)

* Fix

* Update

* Update comment
This commit is contained in:
Pablo Garrido 2021-03-18 10:21:34 +01:00 committed by GitHub
parent a58ac0b3db
commit fd50dbd60e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -210,6 +210,12 @@ bool on_full_input_buffer(ucdrBuffer* ub, void* args)
uxr_set_reliable_buffer_size(&stream->base, history_position, 0);
}
// IMPORTANT: This situation only happens when stream->base.history is not power of two.
if (buffer_size < SUBHEADER_SIZE)
{
return true;
}
ucdr_init_buffer_origin(
ub,
buffer + SUBHEADER_SIZE,