Skip to content

Commit

Permalink
Fix fragment capacity overflow (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
Acuadros95 authored Dec 1, 2021
1 parent 07fa1a7 commit abac482
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/c/core/session/write_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ bool on_full_output_buffer_fragmented(
0u,
uxr_get_reliable_buffer_size(&stream->base, stream->last_written));

if (local_args->data_size <= buffer_capacity)
if ((local_args->data_size + SUBHEADER_SIZE + WRITE_DATA_PAYLOAD_SIZE) <= buffer_capacity)
{
uxr_buffer_submessage_header(&temp_ub, SUBMESSAGE_ID_FRAGMENT, (uint16_t) local_args->data_size,
FLAG_LAST_FRAGMENT);
Expand Down

0 comments on commit abac482

Please sign in to comment.