diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-03-21 05:32:34 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-21 05:36:07 +0300 |
commit | 8ecaa2d6247df7ff2e50e4a317295078a41cc7fe (patch) | |
tree | 8f7f0546a10fc21dd8347e497b900dfd4f84c436 /source/blender/blenkernel/intern | |
parent | b9123b806fc4d17d684c0cc7057c0d3c7136d067 (diff) |
Fix T96510: ASAN failure when selecting text in Text Editor
Regression in 541ba689913e8359216a61a67a60425837af88a9
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 43b2db0d62c..8759d7a0e5f 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1501,7 +1501,8 @@ char *txt_sel_to_buf(Text *text, size_t *r_buf_strlen) if (linef == linel) { length = charl - charf; buf = MEM_mallocN(length + 1, "sel buffer"); - memcpy(buf, linef->line + charf, length + 1); + memcpy(buf, linef->line + charf, length); + buf[length] = '\0'; } else { /* Add 1 for the '\n' */ |