xmloff: fix stack-use-after-return in SvXMLExport::exportDoc()

PropertySetInfo(PropertyMapEntry const * pMap) stores the pointers,
and its lifetime is controlled by refcounting, so the lifetime
of aInfoMap can't be automatic.

ERROR: AddressSanitizer: stack-use-after-return on address ...
... is located in stack of thread T46
at offset 224 in frame SvXMLExport::exportDoc(xmloff::token::XMLTokenEnum)

This frame has 39 object(s):
  ...
  [224, 288) 'aInfoMap' <== Memory access at offset 224 is inside this variable

Change-Id: I4eaa9d38bab708b222d999b0982100d7ef97e95c
This commit is contained in:
Michael Stahl
2017-09-19 21:43:23 +02:00
parent eba34a557c
commit ee599ea463

View File

@@ -1285,7 +1285,7 @@ ErrCode SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
{
try
{
::comphelper::PropertyMapEntry const aInfoMap[] =
static ::comphelper::PropertyMapEntry const aInfoMap[] =
{
{ OUString("Class"), 0,
::cppu::UnoType<OUString>::get(),