forked from boostorg/container
Fixes #151 ("Buffer overflow in monotonic_buffer_resource::do_allocate").
This commit is contained in:
1 parent
4f37a023b0
commit
90de9533ec
2 files changed
+4
No files matched your search
@@ -141,6 +141,9 @@ void* monotonic_buffer_resource::do_allocate(std::size_t bytes, std::size_t alig
|
||||
//See if there is room in current buffer
|
||||
std::size_t aligner = 0u;
|
||||
if(this->remaining_storage(alignment, aligner) < bytes){
|
||||
//The new buffer will be aligned to the strictest alignment so reset
|
||||
//the aligner, which was needed for the old buffer.
|
||||
aligner = 0u;
|
||||
//Update next_buffer_size to at least bytes
|
||||
this->increase_next_buffer_at_least_to(bytes);
|
||||
//Now allocate and update internal data
|
||||
|
||||
Reference in new issue
Block a user