Skip to content

Commit

Permalink
Added vector patch to fix overflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
LePresidente committed Apr 15, 2017
1 parent caf811c commit e8e4e9c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions patches/boost_vector_overflow.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- boost/container/vector.hpp Thu Dec 22 14:33:14 2016
+++ boost - Copy/container/vector.hpp Sat Apr 15 13:00:54 2017
@@ -2255,7 +2255,7 @@
boost::uintptr_t const capaddr = boost::uintptr_t(this->priv_raw_begin() + c);
boost::uintptr_t const aligned_addr = (addr + szt_align_mask) & ~szt_align_mask;
indexes = reinterpret_cast<size_type *>(aligned_addr);
- std::size_t index_capacity = (aligned_addr >= capaddr) ? 0u : (capaddr - addr)/sizeof(size_type);
+ std::size_t index_capacity = (aligned_addr >= capaddr) ? 0u : (capaddr - aligned_addr)/sizeof(size_type);

//Capacity is constant, we're not going to change it
if(index_capacity < PosCount){

0 comments on commit e8e4e9c

Please sign in to comment.