Using strcpy() in GetDataHere() added an extra NUL at the end which didn't fit into the buffer of the size returned by GetDataSize(). This could have been also fixed by returning an extra byte from the latter function, but as the string doesn't need to be NUL-terminated, apparently, just use memcpy() with the correct number of bytes instead. Also, because the string is not necessarily NUL-terminated, use the provided length in wxHTMLDataObject::SetData() instead of relying on the buffer being NUL-terminated and reading uninitialized memory beyond its size. Add a unit test confirming that there are no more ASAN errors when using this class. Closes #23660. Co-Authored-By: mcorino <martin@corino.nl> |
||
|---|---|---|
| .. | ||
| dynamiclib.cpp | ||
| environ.cpp | ||
| garbage.cpp | ||
| guifuncs.cpp | ||
| metatest.cpp | ||
| misctests.cpp | ||
| module.cpp | ||
| pathlist.cpp | ||
| safearrayconverttest.cpp | ||
| selstoretest.cpp | ||
| settings.cpp | ||
| typeinfotest.cpp | ||