Closed cehteh closed 1 month ago
I double checked that this doesn't cause any weird behavior in the resizing code. It makes sense since the new element hasn't actually been added until it is written. Good find! Thank you for the contribution.
Change is officially live as header-vec
version 0.1.3
.
Updating len before the allocation make the last element being uninitialized. When allocation fails and stack unwinds then the Drop will try to drop uninitialized memory at the last element. This would result in UB.