Skip to content

Commit 0c96502

Browse files
sizeof('c')=4, not 1: fix overallocation (#459)
1 parent a082f8a commit 0c96502

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/h1_encoder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,9 @@ static size_t s_calculate_chunk_line_size(const struct aws_http1_chunk_options *
489489
size_t chunk_line_size = MAX_ASCII_HEX_CHUNK_STR_SIZE + CRLF_SIZE;
490490
for (size_t i = 0; i < options->num_extensions; ++i) {
491491
struct aws_http1_chunk_extension *chunk_extension = options->extensions + i;
492-
chunk_line_size += sizeof(';');
492+
chunk_line_size += 1 /* ; */;
493493
chunk_line_size += chunk_extension->key.len;
494-
chunk_line_size += sizeof('=');
494+
chunk_line_size += 1 /* = */;
495495
chunk_line_size += chunk_extension->value.len;
496496
}
497497
return chunk_line_size;

0 commit comments

Comments
 (0)