Scintilla 3.3.2 suffers from a memory access bug upon DnD. When moving a potion of text with DnD, 1 invalid byte is read. 3.3.1 works fine.
My first researches makes me believe that it's because the recent move to std::string (and precisely d3644b41bee8, from a bisect) changed the length passed to SelectionText::Copy() by one, missing the '\0' on some calls. That is, allocating one more byte for SelectionText::s and manually adding it after the copy seems to fix the issue.
I'm not sure what the right/preferred fix is -- either fixing the calls or making SelectionText::Copy() take care of the terminator.
Attached is the Valgrind output right after a drop.
 BTW, why using a manual loop instead of memcpy()? memcpy() is probably faster but on very tiny strings.
Log in to post a comment.