diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-09-19 21:43:23 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-09-24 17:21:48 +0200 |
commit | 89a5b2c31b4c9d5e068e9d1aef2eac50d70df80e (patch) | |
tree | 722fcfc78a5358ef7bd20b8095b3982fb556f1fa | |
parent | 174e8475b912d6b64f424d05f563d2ceff11d621 (diff) |
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
(cherry picked from commit ee599ea46365adc37f4d495d9ff9778c25c04c92)
Reviewed-on: https://gerrit.libreoffice.org/42504
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index bfb18b8e0853..6c38127b9462 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1284,7 +1284,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) { try { - ::comphelper::PropertyMapEntry const aInfoMap[] = + static ::comphelper::PropertyMapEntry const aInfoMap[] = { { OUString("Class"), 0, ::cppu::UnoType<OUString>::get(), |