Blame SOURCES/0001-Resolves-rhbz-1643752-bounds-check-m_currentTable-ac.patch

36aeae
diff -ru libwpd-0.10.2/src/lib/WP6ContentListener.cpp libwpd-0.10.2.new/src/lib/WP6ContentListener.cpp
36aeae
--- libwpd-0.10.2/src/lib/WP6ContentListener.cpp	2017-09-08 18:04:25.000000000 +0100
36aeae
+++ libwpd-0.10.2.new/src/lib/WP6ContentListener.cpp	2018-10-30 10:54:22.326697162 +0000
36aeae
@@ -1311,7 +1311,10 @@
36aeae
 		m_ps->m_tableDefinition.m_columnsProperties.clear();
36aeae
 
36aeae
 		// pull a table definition off of our stack
36aeae
-		m_parseState->m_currentTable = m_parseState->m_tableList[m_parseState->m_nextTableIndice++];
36aeae
+		auto index = m_parseState->m_nextTableIndice++;
36aeae
+		if (index >= m_parseState->m_tableList.size())
36aeae
+			throw ParseException();
36aeae
+		m_parseState->m_currentTable = m_parseState->m_tableList[index];
36aeae
 		if (!m_parseState->m_currentTable)
36aeae
 			throw ParseException();
36aeae
 		m_parseState->m_currentTable->makeBordersConsistent();
36aeae
diff -ru libwpd-0.10.2/src/lib/WPXTable.h libwpd-0.10.2.new/src/lib/WPXTable.h
36aeae
--- libwpd-0.10.2/src/lib/WPXTable.h	2015-12-30 08:27:30.000000000 +0000
36aeae
+++ libwpd-0.10.2.new/src/lib/WPXTable.h	2018-10-30 10:55:41.264362182 +0000
36aeae
@@ -92,6 +92,10 @@
36aeae
 	{
36aeae
 		m_tableList->push_back(table);
36aeae
 	}
36aeae
+	size_t size() const
36aeae
+	{
36aeae
+		return m_tableList->size();
36aeae
+	}
36aeae
 
36aeae
 private:
36aeae
 	void release();