office-gobmx/external/libetonyek/ubsan.patch
Caolán McNamara ce07d65f1f grab an early libetonyek-0.1.8 snapshot
Change-Id: Ib31a8cb75f4cebcaa974b95097270362b3b26aef
Reviewed-on: https://gerrit.libreoffice.org/52689
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-17 21:41:41 +02:00

11 lines
411 B
Diff

--- src/lib/libetonyek_xml.cpp
+++ src/lib/libetonyek_xml.cpp
@@ -35,7 +35,7 @@
unsigned long bytesRead = 0;
const unsigned char *const bytes = input->read((unsigned long)len, bytesRead);
- std::memcpy(buffer, bytes, static_cast<size_t>(bytesRead));
+ if (bytesRead != 0) std::memcpy(buffer, bytes, static_cast<size_t>(bytesRead));
return static_cast<int>(bytesRead);
}
catch (...)