Closed W4RH4WK closed 9 months ago
Hello,
Thanks for looking at this issue and for the PR. I'm going to have to think a bit about this to see if this is the way we want to fix the issue.
In the meantime, I've noticed we don't have a CLA from you yet, could you please go here and fill out the form? We'll need it if we decide this is the way to go to solve the issue.
As pointed out in #454, when fixed_string gets resized but capacity stays within SSO capacity the null-terminator gets copied over as well. The corresponding code assumes heap capacity is always greater than SSO capacity. fixed_string's internal buffer is handled as heap inside the string class and may, in fact, be <= SSO capacity.
This commit fixes the described issue and adds a unit test for this specific case.