Fix T96510: ASAN failure when selecting text in Text Editor
Regression in 541ba68991
This commit is contained in:
parent
b9123b806f
commit
8ecaa2d624
Notes:
blender-bot
2023-02-14 08:28:46 +01:00
Referenced by issue #96510, ASAN failure when selecting text in Text Editor
|
@ -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' */
|
||||
|
|
Loading…
Reference in New Issue