Skip to content

Commit

Permalink
sizeof('c')=4, not 1: fix overallocation (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabijaczleweli authored Dec 18, 2023
1 parent a082f8a commit 0c96502
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/h1_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ static size_t s_calculate_chunk_line_size(const struct aws_http1_chunk_options *
size_t chunk_line_size = MAX_ASCII_HEX_CHUNK_STR_SIZE + CRLF_SIZE;
for (size_t i = 0; i < options->num_extensions; ++i) {
struct aws_http1_chunk_extension *chunk_extension = options->extensions + i;
chunk_line_size += sizeof(';');
chunk_line_size += 1 /* ; */;
chunk_line_size += chunk_extension->key.len;
chunk_line_size += sizeof('=');
chunk_line_size += 1 /* = */;
chunk_line_size += chunk_extension->value.len;
}
return chunk_line_size;
Expand Down

0 comments on commit 0c96502

Please sign in to comment.