summaryrefslogtreecommitdiff
path: root/external/libetonyek/ubsan.patch
blob: 3b5e64ec7046fabe34f6658438e4ddf45460540a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- src/lib/contexts/IWORKPropertyMapElement.cpp
+++ src/lib/contexts/IWORKPropertyMapElement.cpp
@@ -264,7 +264,7 @@
 
 void AlignmentElement::endOfElement()
 {
-  IWORKAlignment prop;
+  IWORKAlignment prop = IWORK_ALIGNMENT_LEFT;
 
   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 (...)