diff options
author | David Tardon <dtardon@redhat.com> | 2017-11-27 16:12:26 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2017-11-27 16:12:26 +0100 |
commit | f6f4e66895284ebeaf2bc80f29cfa2d3776e9f7b (patch) | |
tree | d9dbdd101b5ee325c84dfa051f1248a7cb24e64e | |
parent | 8c57c864ef93556e11133350d42f8441151d25e2 (diff) |
ofz#4420 avoid signed integer overflow
Change-Id: Id8c52d600350a4469e506395d75619d111160db0
-rw-r--r-- | src/lib/ABWStylesCollector.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/ABWStylesCollector.cpp b/src/lib/ABWStylesCollector.cpp index 20848f7..da2fd9e 100644 --- a/src/lib/ABWStylesCollector.cpp +++ b/src/lib/ABWStylesCollector.cpp @@ -175,7 +175,11 @@ void libabw::ABWStylesCollector::openCell(const char *props) parsePropString(props, m_ps->m_tableStates.top().m_currentCellProperties); int currentRow(0); if (!findInt(_findCellProperty("top-attach"), currentRow)) - currentRow = m_ps->m_tableStates.top().m_currentTableRow + 1; + { + currentRow = m_ps->m_tableStates.top().m_currentTableRow; + if (currentRow < std::numeric_limits<int>::max()) + ++currentRow; + } if (m_ps->m_tableStates.top().m_currentTableRow < currentRow) m_ps->m_tableStates.top().m_currentTableRow = currentRow; |