sdext/source/pdfimport/pdfparse/pdfentries.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 9f2ffd3dfd6af9a3e558734138cc155f5dcb8be7 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Oct 18 09:32:19 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Oct 18 12:50:48 2019 +0200 cid#1448423 silence Wrapper object use after free Change-Id: I5369a82507845bbe248c35c7faf517ac57f73f67 Reviewed-on: https://gerrit.libreoffice.org/81025 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx index b9c3c822c45a..ef2d4dc671a5 100644 --- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx @@ -527,13 +527,14 @@ void PDFDict::insertValue( const OString& rName, std::unique_ptr<PDFEntry> pValu if( ! pValue ) eraseValue( rName ); - auto pValueTmp = pValue.get(); + PDFEntry* pValueTmp = nullptr; std::unordered_map<OString,PDFEntry*>::iterator it = m_aMap.find( rName ); if( it == m_aMap.end() ) { // new name/value, pair, append it m_aSubElements.emplace_back(std::make_unique<PDFName>(rName)); m_aSubElements.emplace_back( std::move(pValue) ); + pValueTmp = m_aSubElements.back().get(); } else { @@ -543,10 +544,12 @@ void PDFDict::insertValue( const OString& rName, std::unique_ptr<PDFEntry> pValu if( m_aSubElements[i].get() == it->second ) { m_aSubElements[i] = std::move(pValue); + pValueTmp = m_aSubElements[i].get(); bFound = true; break; } } + assert(pValueTmp); m_aMap[ rName ] = pValueTmp; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits