Skip to content

Conversation

@Acuadros95
Copy link
Contributor

@Acuadros95 Acuadros95 commented Dec 1, 2021

Last fragment contains local_args->data_size + SUBHEADER_SIZE + WRITE_DATA_PAYLOAD_SIZE data, and previous if condition only checks for local_args->data_size <= buffer_capacity:

if (local_args->data_size <= buffer_capacity)
{
uxr_buffer_submessage_header(&temp_ub, SUBMESSAGE_ID_FRAGMENT, (uint16_t) local_args->data_size,
FLAG_LAST_FRAGMENT);
uxr_set_reliable_buffer_size(&stream->base, stream->last_written,
local_args->data_size + SUBHEADER_SIZE + WRITE_DATA_PAYLOAD_SIZE);
}

@Acuadros95 Acuadros95 requested a review from pablogs9 December 1, 2021 10:49
@pablogs9
Copy link
Contributor

pablogs9 commented Dec 1, 2021

Good catch

@Acuadros95 Acuadros95 merged commit abac482 into develop Dec 1, 2021
@pablogs9 pablogs9 deleted the fix/fragment_overflow branch December 1, 2021 10:54
roncapat pushed a commit to roncapat/Micro-XRCE-DDS-Client that referenced this pull request Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants