office-gobmx/starmath
Michael Stahl 32c43ee75c starmath: fix real use-after-free detected by GCC 12
In file included from starmath/inc/mathml/iterator.hxx:12,
                 from starmath/source/mathml/iterator.cxx:10:
In member function ‘SmMlElement* SmMlElement::getParentElement()’,
    inlined from ‘void mathml::SmMlIteratorBottomToTop(SmMlElement*, runType, void*) [with runType = void (*)(SmMlElement*, void*)]’ at starmath/inc/mathml/iterator.hxx:43:39,
    inlined from ‘void mathml::SmMlIteratorFree(SmMlElement*)’ at starmath/source/mathml/iterator.cxx:57:28:
starmath/inc/mathml/element.hxx:263:46: error: pointer ‘pCurrent’ used after ‘void operator delete(void*, std::size_t)’ [-Werror=use-after-free]
  263 |     SmMlElement* getParentElement() { return m_aParentElement; };
      |                                              ^~~~~~~~~~~~~~~~
In function ‘void mathml::deleteElement(SmMlElement*, void*)’,
    inlined from ‘void mathml::deleteElement(SmMlElement*, void*)’ at starmath/source/mathml/iterator.cxx:19:20,
    inlined from ‘void mathml::SmMlIteratorBottomToTop(SmMlElement*, runType, void*) [with runType = void (*)(SmMlElement*, void*)]’ at starmath/inc/mathml/iterator.hxx:65:21,
    inlined from ‘void mathml::SmMlIteratorFree(SmMlElement*)’ at starmath/source/mathml/iterator.cxx:57:28:
starmath/source/mathml/iterator.cxx:19:77: note: call to ‘void operator delete(void*, std::size_t)’ here
   19 | static inline void deleteElement(SmMlElement* aSmMlElement, void*) { delete aSmMlElement; }
      |                                                                             ^~~~~~~~~~~~

Change-Id: I09acfe3f7e90bd7f919cfba161f72bdd7a8da70a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134742
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-23 10:48:56 +02:00
..
inc Simplify SmElementsControl 2022-05-19 22:31:20 +02:00
qa
sdi
source starmath: fix real use-after-free detected by GCC 12 2022-05-23 10:48:56 +02:00
uiconfig/smath GtkCellRendererText 'text" attrib is the index of the text into the model 2022-05-18 09:46:16 +02:00
util
AllLangMoTarget_sm.mk
CppunitTest_starmath_dialogs_test.mk
CppunitTest_starmath_export.mk
CppunitTest_starmath_import.mk
CppunitTest_starmath_qa_cppunit.mk
IwyuFilter_starmath.yaml
JunitTest_starmath_unoapi.mk
Library_sm.mk tdf#125931: add Properties panel to Math's Properties deck 2022-04-27 16:33:44 +02:00
Library_smd.mk
Makefile
Module_starmath.mk
README.md
UIConfig_smath.mk tdf#125931: add Properties panel to Math's Properties deck 2022-04-27 16:33:44 +02:00
visual-editor-todo

Formula Editor Code for LibreOffice Writer

Good overview from the original developer:

http://www.mail-archive.com/dev@sw.openoffice.org/msg00200.html