diff options
-rw-r--r-- | external/libetonyek/ubsan.patch | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/external/libetonyek/ubsan.patch b/external/libetonyek/ubsan.patch index f0ab1475a5fb..3b5e64ec7046 100644 --- a/external/libetonyek/ubsan.patch +++ b/external/libetonyek/ubsan.patch @@ -9,3 +9,14 @@ if (m_value) { +--- src/lib/libetonyek_xml.cpp ++++ src/lib/libetonyek_xml.cpp +@@ -33,7 +33,7 @@ + unsigned long bytesRead = 0; + const unsigned char *const bytes = input->read(len, bytesRead); + +- std::memcpy(buffer, bytes, static_cast<int>(bytesRead)); ++ if (bytesRead != 0) std::memcpy(buffer, bytes, static_cast<int>(bytesRead)); + return static_cast<int>(bytesRead); + } + catch (...) |