summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2025-05-23 09:43:34 +1000
committerMaxime Coste <mawww@kakoune.org>2025-05-23 09:43:34 +1000
commitb0f541aae65c06f828245e6f90a40967f8e98322 (patch)
treee8b4f64a5c6bf5839d24f6f0d6e83cc3b8806649 /test
parent93e3037e490195af39f22ae42eaf82a74774e475 (diff)
Fix out-of-bounds write in short strings when reaching capacity
When we reach capacity for Short strings, we re-use the field past the buffer (remaining_capacity) to hold the terminal null character, this works well but the code was trying to set it twice: when computing the remaining capacity (which is 0 when we hit capacity), and when setting the null character. While this second operation should be fine in practice, it is technically undefined behaviour as we overwrite it by accessing past the end of the buffer.
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions