From f2bd38b638e95bacc391930ed28adef587a83fbc Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sun, 31 May 2015 06:45:54 +0200 Subject: [PATCH] avoid uninitialized value --- 0001-avoid-use-of-uninitialized-value.patch | 75 +++++++++++++++++++++ libetonyek.spec | 1 + 2 files changed, 76 insertions(+) create mode 100644 0001-avoid-use-of-uninitialized-value.patch diff --git a/0001-avoid-use-of-uninitialized-value.patch b/0001-avoid-use-of-uninitialized-value.patch new file mode 100644 index 0000000..f438bca --- /dev/null +++ b/0001-avoid-use-of-uninitialized-value.patch @@ -0,0 +1,75 @@ +From 60c22fc853d7db4ff3ffc1661202fb3db537dbd7 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Sat, 30 May 2015 15:19:32 +0200 +Subject: [PATCH] avoid use of uninitialized value + +Change-Id: I61c695ca8366ac366d3d450ef8e45cd4eba33fda +--- + src/lib/contexts/IWORKPropertyMapElement.cpp | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +diff --git a/src/lib/contexts/IWORKPropertyMapElement.cpp b/src/lib/contexts/IWORKPropertyMapElement.cpp +index 6788137..5d94134 100644 +--- a/src/lib/contexts/IWORKPropertyMapElement.cpp ++++ b/src/lib/contexts/IWORKPropertyMapElement.cpp +@@ -264,10 +264,10 @@ IWORKXMLContextPtr_t AlignmentElement::element(const int name) + + void AlignmentElement::endOfElement() + { +- IWORKAlignment prop; +- + if (m_value) + { ++ IWORKAlignment prop(IWORK_ALIGNMENT_LEFT); ++ + switch (get(m_value)) + { + case 0 : +@@ -285,9 +285,9 @@ void AlignmentElement::endOfElement() + default : + ETONYEK_DEBUG_MSG(("unknown alignment %d\n", get(m_value))); + } +- } + +- m_propMap.put(prop); ++ m_propMap.put(prop); ++ } + } + + } +@@ -373,7 +373,8 @@ void CapitalizationElement::endOfElement() + { + if (m_capitalization) + { +- IWORKCapitalization prop; ++ IWORKCapitalization prop(IWORK_CAPITALIZATION_NONE); ++ + switch (get(m_capitalization)) + { + case 0 : +@@ -624,20 +625,17 @@ void SuperscriptElement::endOfElement() + { + if (m_superscript) + { +- IWORKBaseline prop; + switch (get(m_superscript)) + { + case 1 : +- prop = IWORK_BASELINE_SUPER; ++ m_propMap.put(IWORK_BASELINE_SUPER); + break; + case 2 : +- prop = IWORK_BASELINE_SUB; ++ m_propMap.put(IWORK_BASELINE_SUB); + break; + default : + ETONYEK_DEBUG_MSG(("unknown superscript %d\n", get(m_superscript))); + } +- +- m_propMap.put(prop); + } + } + +-- +1.9.3 + diff --git a/libetonyek.spec b/libetonyek.spec index 03c5bf0..a7754e6 100644 --- a/libetonyek.spec +++ b/libetonyek.spec @@ -22,6 +22,7 @@ BuildRequires: pkgconfig(zlib) Patch0: 0001-fix-test-on-i386.patch Patch1: 0001-add-missing-breaks.patch Patch2: 0002-remove-surplus-breaks.patch +Patch3: 0001-avoid-use-of-uninitialized-value.patch %description %{name} is library for import of documents from Apple iWork applications