diff options
| author | Maxime Coste <mawww@kakoune.org> | 2025-05-23 09:43:34 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2025-05-23 09:43:34 +1000 |
| commit | b0f541aae65c06f828245e6f90a40967f8e98322 (patch) | |
| tree | e8b4f64a5c6bf5839d24f6f0d6e83cc3b8806649 /src/buffer.cc | |
| parent | 93e3037e490195af39f22ae42eaf82a74774e475 (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 'src/buffer.cc')
0 files changed, 0 insertions, 0 deletions
