From 764e3016b62665281539af4e990ca4ff0445c26c Mon Sep 17 00:00:00 2001 From: "Matthew J. Francis" Date: Sat, 20 Sep 2014 12:14:41 +0800 Subject: fdo#84086 Fix assorted use-after-free bugs Change-Id: Iec004fffdb0afbe27bd69f379db90f6d904a8a65 Reviewed-on: https://gerrit.libreoffice.org/11553 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- fpicker/source/office/OfficeControlAccess.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fpicker') diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx index fe45acd860d0..1ac55e03fa52 100644 --- a/fpicker/source/office/OfficeControlAccess.cxx +++ b/fpicker/source/office/OfficeControlAccess.cxx @@ -238,7 +238,8 @@ namespace svt { Control* pControl = NULL; ControlDescription tmpDesc; - tmpDesc.pControlName = OUStringToOString(_rControlName, RTL_TEXTENCODING_UTF8).getStr(); + OString aControlName = OUStringToOString( _rControlName, RTL_TEXTENCODING_UTF8 ); + tmpDesc.pControlName = aControlName.getStr(); // translate the name into an id ControlDescRange aFoundRange = ::std::equal_range( s_pControls, s_pControlsEnd, tmpDesc, ControlDescriptionLookup() ); @@ -319,7 +320,8 @@ namespace svt bool OControlAccess::isControlSupported( const OUString& _rControlName ) { ControlDescription tmpDesc; - tmpDesc.pControlName = OUStringToOString(_rControlName, RTL_TEXTENCODING_UTF8).getStr(); + OString aControlName = OUStringToOString(_rControlName, RTL_TEXTENCODING_UTF8); + tmpDesc.pControlName = aControlName.getStr(); return ::std::binary_search( s_pControls, s_pControlsEnd, tmpDesc, ControlDescriptionLookup() ); } -- cgit