Skip to content
Snippets Groups Projects
Commit ad73ab02 authored by Dominik Loidolt's avatar Dominik Loidolt
Browse files

Prevent buffer overflow in chunk compression

parent c2b05ca1
No related branches found
No related tags found
1 merge request!26Adapt cmp_tool to the chunk decompression
...@@ -2678,6 +2678,8 @@ int32_t compress_chunk(void *chunk, uint32_t chunk_size, ...@@ -2678,6 +2678,8 @@ int32_t compress_chunk(void *chunk, uint32_t chunk_size,
debug_print("Error: The chunk contains collections with an incompatible mix of subservices.\n"); debug_print("Error: The chunk contains collections with an incompatible mix of subservices.\n");
return -1; return -1;
} }
if (read_bytes + cmp_col_get_size(col) > chunk_size)
break;
cmp_size_byte = cmp_collection((uint8_t *)col, col_model, col_up_model, cmp_size_byte = cmp_collection((uint8_t *)col, col_model, col_up_model,
dst, dst_capacity, &cfg, cmp_size_byte); dst, dst_capacity, &cfg, cmp_size_byte);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment